aboutsummaryrefslogtreecommitdiff
path: root/scripts/data.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/data.py')
-rw-r--r--scripts/data.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/data.py b/scripts/data.py
index fadf9613..2eedb22e 100644
--- a/scripts/data.py
+++ b/scripts/data.py
@@ -16,6 +16,7 @@ def populate_lookup_dicts():
for card in set_dir.iterdir():
SETS_TO_CARDS[set_name].append(card.stem)
CARDS_TO_SETS[card.stem] = set_name
+ CARDS_TO_SETS[f'{set_name}/{card.stem}'] = set_name
def name2set(card: str) -> str:
@@ -62,12 +63,14 @@ def name2cardlisting(card: str) -> str:
The returned target can be used to directly navigate the
card listing to the specific card.
- Card listing targets are all lower case and use '-' instead of
- whitespace.
+ Card listing targets are all lower case and use '-' instead of whitespace.
Ending '!' are stripped from the card names.
+ If a path including the set is given only the card part is considered.
:param card: the english name of a card
:returns: the card listing target
"""
+ if '/' in card:
+ card = card.split('/')[-1]
return card.lower().replace(' ', '-').replace('!', '')