summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server/Plugin.py')
-rw-r--r--src/lib/Server/Plugin.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index 8d944e7f8..2f23f76a5 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -187,8 +187,12 @@ class StructFile(XMLFileBacked):
and not isinstance(item, lxml.etree._Comment)]
for group in [item for item in worklist if item.tag == 'Group']:
# if only python had forceable early-binding
- newpred = eval("lambda x:'%s' in x.groups and predicate(x)" % (group.get('name')),
- {'predicate':predicate})
+ if group.get('negate', 'false') == 'true':
+ cmd = "lambda x:'%s' not in x.groups and predicate(x)"
+ else:
+ cmd = "lambda x:'%s' in x.groups and predicate(x)"
+
+ newpred = eval(cmd % (group.get('name')), {'predicate':predicate})
work[newpred] = group.getchildren()
def Match(self, metadata):