Skip to content

Commit

Permalink
Added check_moves.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
encukou committed Oct 22, 2010
1 parent 45d67fd commit e8b3c8a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions util/check_moves.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Check if moves of pokemon in species.xml match moves in moves.xml
Useful for finding capitalization errors/misspellings
"""

from xml.etree import ElementTree

mt=ElementTree.parse(open('moves.xml'))
movenames = set(m.attrib['name'] for m in mt.findall('move'))

t=ElementTree.parse(open('species.xml'))
parent_map = dict((c, p) for p in t.getiterator() for c in p)

for m in [m for m in t.findall('*/*/*/move') if m.text not in movenames]:
print parent_map[parent_map[parent_map[m]]].attrib['name'] + ':', m.text

0 comments on commit e8b3c8a

Please sign in to comment.