aboutsummaryrefslogtreecommitdiff
path: root/make_table.py
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2019-12-20 18:04:24 +0100
committerDaniel Schadt <kingdread@gmx.de>2019-12-20 18:04:24 +0100
commit9f4a4eaa06f3d0136de9088c0e60a0c077248c91 (patch)
tree4ab0e0c9f5910643ac6404c390e6aa6fad4ca470 /make_table.py
parent087580b3c269dbc5b2298ff6f4590f010279d339 (diff)
downloadkondou-9f4a4eaa06f3d0136de9088c0e60a0c077248c91.tar.gz
kondou-9f4a4eaa06f3d0136de9088c0e60a0c077248c91.tar.bz2
kondou-9f4a4eaa06f3d0136de9088c0e60a0c077248c91.zip
remove hard coded palette IDs
Now that the API actually returns the proper palette IDs, we can use those values instead of relying on the hard coded values. This also gets rid of the make_table script that was mostly hackish anyway, and the lazy static HashMap.
Diffstat (limited to 'make_table.py')
-rw-r--r--make_table.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/make_table.py b/make_table.py
deleted file mode 100644
index 444211d..0000000
--- a/make_table.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""This script is used to downlaod the skill palette data.
-
-The Guild Wars 2 chat links for build templates use a different skill ID than
-the API, so skills need to be mapped from their "skill ID" to the corresponding
-"palette ID".
-
-Some game updates may require this mapping to be updated as well, otherwise the
-chat link parsing/generating functionality might be broken.
-
-To use this script, pipe the output to src/skill_palette.json and rebuild
-kondou.
-"""
-import requests
-import json
-from lxml import html, etree
-
-data = requests.get("https://wiki.guildwars2.com/wiki/Chat_link_format")
-parsed = html.fromstring(data.content)
-body = parsed.find(".//table")
-iterator = iter(body)
-next(iterator)
-result = []
-for row in iterator:
- if "-" in row[3].text:
- continue
- # For some reason, some skills have multiple IDs. It is not quite clear
- # what they are for, it sometimes seems to be the traited version, and
- # sometimes the underwater version. Then again, some of the IDs are also
- # invalid API IDs, which makes the whole thing a bit weird. Since we don't
- # care about underwater combat at the moment (and so does nobody else in
- # GW2) nor about the traited version of skills, we'll just stick with the
- # first ID. For rendering it shouldn't matter anyway, as all of them
- # usually share the same icon.
- ids = row[3].text.strip().split(";")
- palette_id = int(row[4].text)
- skill_id = int(ids[0])
- result.append((skill_id, palette_id))
-print(json.dumps(result))