-
Notifications
You must be signed in to change notification settings - Fork 1
/
info.py
47 lines (34 loc) · 867 Bytes
/
info.py
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
38
39
40
41
42
43
44
45
46
47
# Script is run after stable release, pack ../fujihack/ info into JS file
import os, json, re
fh = os.path.abspath("../fujihack")
models = [
]
model = os.listdir(fh + "/model")
print("Attempt compile:", model)
for m in model:
name = m.split(".")[0]
if name == "template" or name == "stub":
continue
data = {
"name": name,
"file": "",
}
# Figure out better parsing solution later?
f = open(fh + "/model/" + name + ".h", "r")
data["data"] = f.read()
f.close()
models.append(data)
files = {
}
patch = os.listdir(fh + "/patch")
for p in patch:
f = open(fh + "/patch/" + p, "r")
files[p] = f.read()
f.close()
info = {
"files": files,
"models": models
}
f = open("data.js", "w")
f.write("var fujihack_data = " + json.dumps(info, indent=4, sort_keys=True) + ";")
f.close()