X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fruntime.py;fp=sfatables%2Fruntime.py;h=e948d0510b5475d8bd7741938597a2e75e272de6;hb=429e5214b5e839964e10d540bea97480fb6fcd74;hp=8f5c323f7ce1d2cf9245820ee946cc0240e95e3e;hpb=805a8364a6ce7295edb2bad37bd26e12e3dbecac;p=sfa.git diff --git a/sfatables/runtime.py b/sfatables/runtime.py index 8f5c323f..e948d051 100644 --- a/sfatables/runtime.py +++ b/sfatables/runtime.py @@ -65,29 +65,7 @@ class SFATablesRules: p.xpathFreeContext() return doc - def add_rule_context_to_rspec(self,arguments, doc): - p = doc.xpathNewContext() - context = p.xpathEval("//rspec") - if (not context): - raise Exception('Request is not an rspec') - else: - # Add the request context - ruleNode = libxml2.newNode('rule-context') - ac = self.active_context - for k in ac: - argumentNode = libxml2.newNode('argument') - nameNode = libxml2.newNode('name') - nameNode.addContent(k) - valueNode = libxml2.newNode('value') - valueNode.addContent(ac[k]) - argumentNode.addChild(nameNode) - argumentNode.addChild(valueNode) - ruleNode.addChild(argumentNode) - context[0].addChild(ruleNode) - p.xpathFreeContext() - - return doc - + def apply(self, rspec): doc = libxml2.parseDoc(rspec) doc = self.add_request_context_to_rspec(doc) @@ -95,8 +73,6 @@ class SFATablesRules: intermediate_rspec = doc for rule in self.sorted_rule_list: - import pdb - pdb.set_trace() intermediate_rspec = rule.apply_interpreted(intermediate_rspec) intermediate_rspec = XMLRule().wrap_up(intermediate_rspec) if (rule.terminal):