X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fxmlextension.py;h=4fc1ab5867629de98d4d338a8c18970e8a8ecaf4;hb=483772a0716028a34cb98012fbe252ffd445fedf;hp=412419b064e9e986e5fe6a1930a33ee32465902f;hpb=cf172a653c1d69c73fe5ff7cd93b4cee8187ab79;p=sfa.git diff --git a/sfatables/xmlextension.py b/sfatables/xmlextension.py index 412419b0..4fc1ab58 100644 --- a/sfatables/xmlextension.py +++ b/sfatables/xmlextension.py @@ -8,15 +8,14 @@ import libxml2 from sfatables.globals import * class Xmlextension: - context = "" - processor = "" - operand = "VALUE" - arguments = [] - def __init__(self, dir, component_name): + self.context = "" + self.processor = "" + self.operand = "VALUE" + self.arguments = [] + self.terminal = 0 + filename = dir+"/"+component_name+".xml" - import pdb - pdb.set_trace() self.xmldoc = libxml2.parseFile(filename) # TODO: Check xmldoc against a schema @@ -36,6 +35,9 @@ class Xmlextension: help = p.xpathEval('//rule/argument/help') target = p.xpathEval('//rule/argument/operand') + context = p.xpathEval('//attributes/attribute[@terminal="yes"]') + self.terminal = (context != []) + self.arguments = map(lambda (name,help,target):{'name':name.content,'help':help.content,'target':target.content}, zip(name,help,target)) p.xpathFreeContext()