Fix koffice python syntax errors

This closes Bug 679
pull/1/head
Timothy Pearson 13 years ago
parent c15aa35079
commit 5ec453c258

@ -46,11 +46,11 @@ def test(*args):
if l%2: return args[-1] if l%2: return args[-1]
utility_builtins['test'] = test utility_builtins['test'] = test
def reorder(s, with=None, without=()): def reorder(s, swith=None, swithout=()):
# s, with, and without are sequences treated as sets. # s, swith, and swithout are sequences treated as sets.
# The result is subtract(intersect(s, with), without), # The result is subtract(intersect(s, swith), swithout),
# unless with is None, in which case it is subtract(s, without). # unless swith is None, in which case it is subtract(s, swithout).
if with is None: with=s if swith is None: swith=s
d={} d={}
tt=type(()) tt=type(())
for i in s: for i in s:
@ -61,12 +61,12 @@ def reorder(s, with=None, without=()):
a=r.append a=r.append
h=d.has_key h=d.has_key
for i in without: for i in swithout:
if type(i) is tt and len(i)==2: k, v = i if type(i) is tt and len(i)==2: k, v = i
else: k= v = i else: k= v = i
if h(k): del d[k] if h(k): del d[k]
for i in with: for i in swith:
if type(i) is tt and len(i)==2: k, v = i if type(i) is tt and len(i)==2: k, v = i
else: k= v = i else: k= v = i
if h(k): if h(k):

Loading…
Cancel
Save