Skip to content

Commit

Permalink
add custom links for divination cards
Browse files Browse the repository at this point in the history
  • Loading branch information
lvlvllvlvllvlvl committed Jul 31, 2024
1 parent 8dd6ccf commit 66bfa45
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions PyPoE/cli/exporter/wiki/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
("Low Mana", {"link": "Low Mana"}),
("Full Mana", {"link": "Full Mana"}),
("Mana", {"link": "Mana"}),
("Ward", {"link": "Ward"}),
#
("Chaos Resistance(?:|s)", {"link": "Chaos Resistance"}),
("Cold Resistance(?:|s)", {"link": "Cold Resistance"}),
Expand Down Expand Up @@ -1685,6 +1686,14 @@ class TagHandler:
"Aul's Uprising": "[[%s]]",
}

CUSTOM_LINKS = {
"Cartography Scarab": "[[Cartography Scarab (disambiguation)]]",
"Divination Scarab": "[[Divination Scarab (disambiguation)]]",
"Bestiary Scarab": "[[Bestiary Scarab (disambiguation)]]",
"Sulphite Scarab": "[[Sulphite Scarab (disambiguation)]]",
"Einhar's Memory of Harvest Beasts": "{{il|Einhar's Memory}}",
}

def __init__(self, rr):
"""
Parameters
Expand All @@ -1702,6 +1711,8 @@ def __init__(self, rr):
self.tag_handlers[key] = partial(func, self)

def _check_link(self, string):
if string in self.CUSTOM_LINKS:
return self.CUSTOM_LINKS[string]
if any(category["Text"] == string for category in self.rr["ItemClassCategories.dat64"]):
return "[[%s]]" % string
items = self.rr["BaseItemTypes.dat64"].index["Name"][string]
Expand Down

0 comments on commit 66bfa45

Please sign in to comment.