Skip to content

Commit

Permalink
Merge house infos
Browse files Browse the repository at this point in the history
  • Loading branch information
lBaah authored Mar 1, 2021
1 parent 9388ec8 commit 069afd4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions houses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import xml.etree.ElementTree as ET
hfrom = ET.parse('houses_from.xml')
hTo = ET.parse('houses_to.xml')
houses_from = hfrom.getroot()
houses_to = hTo.getroot()

#cuscus houseificado para senhor fake
for house_from in houses_from:
for house_to in houses_to:
if house_to.get('name') == house_from.get('name'):
house_to.set('clientid', house_from.get('id'))
house_to.set('rent', house_from.get('rent'))
house_to.set('beds', house_from.get('beds'))
house_to.set('guildHall', house_from.get('guildHall'))
house_to.set('shop', house_from.get('shop'))

hTo.write('output.xml')

0 comments on commit 069afd4

Please sign in to comment.