Created
May 15, 2010 19:09
-
-
Save springmeyer/402354 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
from lxml import etree | |
from lxml import objectify | |
keys = [] | |
if __name__ == "__main__": | |
if len(sys.argv) != 2: | |
print>>sys.stderr,'Usage: %s <preset_xml_file>' % sys.argv[0] | |
sys.exit(1) | |
xml = sys.argv[1] | |
tree = objectify.parse(xml) | |
root = tree.getroot() | |
for item in root.group.item: | |
print '#%s' % item.get('name') | |
#import pdb;pdb.set_trace() | |
for text in item.iterchildren(): # text clashes | |
key = text.get('key') | |
if key and key not in keys: | |
print 'node,way %s text linear' % key | |
keys.append(key) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment