Skip to content
Commits on Source (2)
...@@ -214,13 +214,17 @@ class SetupObject(object): ...@@ -214,13 +214,17 @@ class SetupObject(object):
filenames = self.path.glob("*"+self.ext) filenames = self.path.glob("*"+self.ext)
for filename in sorted(filenames): for filename in sorted(filenames):
with open(str(filename)) as xml_file: with open(str(filename)) as xml_file:
if "ref" in str(self.path): try:
content = xmltodict.parse(xml_file)["ReferenceSetup"] if "ref" in str(self.path):
content["filename"] = str(filename) content = xmltodict.parse(xml_file)["ReferenceSetup"]
else: content["filename"] = str(filename)
print(xml_file) else:
content = xmltodict.parse(xml_file)["ObservationBlock"]#["Template"] #print(xml_file)
content["filename"] = str(filename) 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) todos.append(content)
return todos return todos
......