add link to calculating palico
This commit is contained in:
13
db/calculating_palico_weapon_list.json
Normal file
13
db/calculating_palico_weapon_list.json
Normal file
File diff suppressed because one or more lines are too long
28
db/mk_cp_weapon_map.py
Executable file
28
db/mk_cp_weapon_map.py
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Parse the weapon list data from calculating palico, and use it to
|
||||
generate another JSON file mapping the weapon name to the the weapon
|
||||
class qualified id (CLASS.WEAPON_ID) that is used when passing weapon
|
||||
setups in the query parameter.
|
||||
|
||||
See https://github.com/mrmin123/the-calculating-palico
|
||||
"""
|
||||
|
||||
import os.path
|
||||
import json
|
||||
|
||||
import _pathfix
|
||||
from _pathfix import db_path, project_path
|
||||
|
||||
if __name__ == '__main__':
|
||||
inpath = os.path.join(db_path, "calculating_palico_weapon_list.json")
|
||||
outpath = os.path.join(project_path, "web", "data",
|
||||
"calculating_palico_weapon_map.json")
|
||||
|
||||
with open(inpath) as f:
|
||||
weapon_list = json.load(f)
|
||||
weapon_map = dict()
|
||||
for weapon in weapon_list:
|
||||
weapon_map[weapon["name"]] = "%s.%s" % (weapon["class"], weapon["id"])
|
||||
with open(outpath, "w") as f:
|
||||
json.dump(weapon_map, f)
|
||||
Reference in New Issue
Block a user