-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathshops.py
More file actions
27 lines (21 loc) · 694 Bytes
/
shops.py
File metadata and controls
27 lines (21 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import xml.etree.ElementTree as ET
import json
namefile = open('botw_names.json')
object_names = json.load(namefile)
namefile.close()
root = ET.parse('ShopGameDataInfo.xml').getroot().find('./ShopAreaInfo/Values')
shops = {}
for node in root.findall('./*'):
dealer = node.find('./Dealer').text
item = node.find('./Item').text
if dealer not in shops:
shops[dealer] = []
shops[dealer].append(item)
for dealer in sorted(shops):
if dealer in object_names:
print('--- '+object_names[dealer], '('+dealer+') ---')
else:
print('--- '+dealer+' ---')
for item in sorted(shops[dealer]):
print(object_names[item], '('+item+')')
print()