Commit a81757ac by Victor Shnayder

tweaks to cleanup script

don't strip cdata, don't mess with names
parent 5f473f76
...@@ -49,7 +49,7 @@ def cleanup(filepath, remove_meta): ...@@ -49,7 +49,7 @@ def cleanup(filepath, remove_meta):
try: try:
print "Cleaning {0}".format(filepath) print "Cleaning {0}".format(filepath)
with open(filepath) as f: with open(filepath) as f:
parser = etree.XMLParser(remove_comments=False) parser = etree.XMLParser(remove_comments=False, strip_cdata=False)
xml = etree.parse(filepath, parser=parser) xml = etree.parse(filepath, parser=parser)
except: except:
print "Error parsing file {0}".format(filepath) print "Error parsing file {0}".format(filepath)
...@@ -59,7 +59,7 @@ def cleanup(filepath, remove_meta): ...@@ -59,7 +59,7 @@ def cleanup(filepath, remove_meta):
attrs = node.attrib attrs = node.attrib
if 'url_name' in attrs: if 'url_name' in attrs:
used_names[node.tag].add(attrs['url_name']) used_names[node.tag].add(attrs['url_name'])
if 'name' in attrs: if False and 'name' in attrs:
# Replace name with an identical display_name, and a unique url_name # Replace name with an identical display_name, and a unique url_name
name = attrs['name'] name = attrs['name']
attrs['display_name'] = name attrs['display_name'] = name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment