diff options
Diffstat (limited to 'tools/bundlecvt.py')
-rw-r--r-- | tools/bundlecvt.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/bundlecvt.py b/tools/bundlecvt.py index cae4e2d23..176c9a46d 100644 --- a/tools/bundlecvt.py +++ b/tools/bundlecvt.py @@ -6,7 +6,7 @@ from sys import argv from elementtree.ElementTree import XML, Element, tostring if __name__ == '__main__': - bundles = argv[1] + bname = argv[1] translations = argv[2] tdata = {} @@ -17,14 +17,17 @@ if __name__ == '__main__': if entry.tag == 'Image': continue tdata[data.attrib['system']][entry.tag][entry.attrib['name']] = entry.getchildren() - bundle = XML(open('/home/desai/data/bold/b/ssh.xml').read()) + bundle = XML(open(bname).read()) new = Element('Bundle', version='2.0', name=bundle.attrib['name']) for system in tdata.keys(): b = Element("System", name=system) for entry in bundle.getchildren(): - map(b.append, tdata[system][entry.tag][entry.attrib['name']]) + try: + map(b.append, tdata[system][entry.tag][entry.attrib['name']]) + except: + pass new.append(b) print tostring(new) |