feat(sde): Add a JSON list of all published ship types (#41)
This commit is contained in:
committed by
GitHub
parent
626b9f64df
commit
38b56b4cff
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@@ -57,6 +57,7 @@ jobs:
|
||||
run: |
|
||||
protoc --python_out=. esf.proto
|
||||
python convert.py sde/fsd
|
||||
python list_shiptypes.py sde/fsd
|
||||
|
||||
- name: Fetch icons
|
||||
run: |
|
||||
|
||||
35
list_shiptypes.py
Normal file
35
list_shiptypes.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: python3 convert.py <path/to/eve-sde/fsd>")
|
||||
exit(1)
|
||||
|
||||
path = sys.argv[1]
|
||||
|
||||
os.makedirs("dist", exist_ok=True)
|
||||
|
||||
with open(f"{path}/groupIDs.yaml") as fp:
|
||||
groupIDs = yaml.load(fp, Loader=yaml.CSafeLoader)
|
||||
|
||||
with open(f"{path}/typeIDs.yaml") as fp:
|
||||
typeIDs = yaml.load(fp, Loader=yaml.CSafeLoader)
|
||||
|
||||
ships = []
|
||||
|
||||
for id, entry in typeIDs.items():
|
||||
group = groupIDs[entry["groupID"]]
|
||||
|
||||
if group["categoryID"] == 6 and entry["published"]:
|
||||
ships.append(
|
||||
{
|
||||
"id": id,
|
||||
"name": entry["name"]["en"],
|
||||
"group": group["name"]["en"],
|
||||
}
|
||||
)
|
||||
|
||||
with open("dist/shiptypes.json", "w") as fp:
|
||||
json.dump(ships, fp)
|
||||
Reference in New Issue
Block a user