-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathactor_flags.py
More file actions
37 lines (28 loc) · 784 Bytes
/
actor_flags.py
File metadata and controls
37 lines (28 loc) · 784 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
28
29
30
31
32
33
34
35
36
37
import aamp
import os
import json
namefile = open('botw_names.json')
object_names = json.load(namefile)
namefile.close()
all_flags = {}
for filename in os.listdir('bxml'):
f=open('bxml/' + filename,'rb')
data = aamp.parseAAMP(f.read())
f.close()
actor = filename.split('.')[0]
if actor in object_names:
actor = object_names[actor] + ' (' + actor + ')'
if len(data['SUBLISTS']) > 1:
actor_flags = data['SUBLISTS'][1]
else:
actor_flags = []
for flag in actor_flags:
if flag not in all_flags:
all_flags[flag] = []
all_flags[flag].append(actor)
for flag in sorted(all_flags):
print(flag, len(all_flags[flag]))
while True:
a=input()
if a in all_flags:
print(all_flags[a])