def __init__(self, e, files):
# Every step requires a name.
if 'name' not in e.attrib or len(e.attrib) != 1:
msg = ("Step must have (only) a name attribute. Tag had these "
"attributes: '{}'\n{}".format(", ".join(e.attrib.keys()), ET.tostring(e)))
raise ParseError(msg)
self.name = e.attrib['name'].replace(' ', '_')
self.tools = []
self.code = "S"
for child in e:
t = child.tag
if t not in Step.validTags:
msg = ("Illegal tag in step '{}': \n\n"
"{}\n\nValid Tags: '{}'".format(self.name,
ET.tostring(child).rstrip(),
", ".join(Step.validTags)))
raise ParseError(msg)
self.tools.append(PipelineTool(child, files, e.attrib['name']))
评论列表
文章目录