Commit 1511ec03 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Added OR macro

parent 725ee185
......@@ -24,6 +24,13 @@ class PlutoVariables:
rh = [ m.group(3).format(v, pluto=self.by_name[v][0])
for v in self.by_name if re.match(regexp, v)]
return("%s=%s" % (lh, '*'.join(rh)))
m = re.match('([^=]+)=OR\{(.*),(.*)\}', expr)
if m:
lh = m.group(1)
regexp = m.group(2).replace('*', '.*')
rh = [ m.group(3).format(v, pluto=self.by_name[v][0])
for v in self.by_name if re.match(regexp, v)]
return("%s=%s" % (lh, '+'.join(rh)))
raise Exception('Invalid expression', expr)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment