Skip to content
Commits on Source (2)
......@@ -214,13 +214,17 @@ class SetupObject(object):
filenames = self.path.glob("*"+self.ext)
for filename in sorted(filenames):
with open(str(filename)) as xml_file:
if "ref" in str(self.path):
content = xmltodict.parse(xml_file)["ReferenceSetup"]
content["filename"] = str(filename)
else:
print(xml_file)
content = xmltodict.parse(xml_file)["ObservationBlock"]#["Template"]
content["filename"] = str(filename)
try:
if "ref" in str(self.path):
content = xmltodict.parse(xml_file)["ReferenceSetup"]
content["filename"] = str(filename)
else:
#print(xml_file)
content = xmltodict.parse(xml_file)["ObservationBlock"]#["Template"]
content["filename"] = str(filename)
except Exception as e:
print(e)
raise Exception("invalid xml detected: {}".format(xml_file))
todos.append(content)
return todos
......