diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2021-12-12 15:09:38 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2021-12-12 15:10:34 +0100 |
| commit | 8939a55b4e632f021a423b4508810b2720a7f3b3 (patch) | |
| tree | d11f5b8715d5a9032bb055717ad7f6cfc15b9621 /scripts | |
| parent | 7cf6ae5f8478ac80f1123101595edef96a261d48 (diff) | |
| download | muhqs-game-8939a55b4e632f021a423b4508810b2720a7f3b3.tar.gz muhqs-game-8939a55b4e632f021a423b4508810b2720a7f3b3.zip | |
scripts: improve code quality
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/data.py | 1 | ||||
| -rwxr-xr-x | scripts/generate_card.py | 2 | ||||
| -rwxr-xr-x | scripts/generate_card_hover_links.py | 5 |
3 files changed, 3 insertions, 5 deletions
diff --git a/scripts/data.py b/scripts/data.py index e19a805e..b72fc094 100755 --- a/scripts/data.py +++ b/scripts/data.py @@ -1,3 +1,4 @@ +"""Helper code for the data subdirectory""" from pathlib import Path GAME_ROOT = Path(__file__).parent.parent diff --git a/scripts/generate_card.py b/scripts/generate_card.py index 2ec77b8c..7fb8b33a 100755 --- a/scripts/generate_card.py +++ b/scripts/generate_card.py @@ -103,7 +103,7 @@ def get_latex_field(card: MutableMapping, # NOTE: normal and latex_ fields must have the same data type # (both string or both list of strings). if has_latex: - assert type(latex_value) == type(normal_value) + assert isinstance(latex_value, type(normal_value)) # If the fetched value is not a list we are done here if has_latex: diff --git a/scripts/generate_card_hover_links.py b/scripts/generate_card_hover_links.py index 28b7f017..d3b11f3f 100755 --- a/scripts/generate_card_hover_links.py +++ b/scripts/generate_card_hover_links.py @@ -1,14 +1,11 @@ #!/usr/bin/env python3 import argparse -import pathlib from pathlib import Path import re -from typing import MutableMapping, Tuple -import sys from data import CARDS_TO_SETS -PATTERN = re.compile('\{\{(?P<card>.*?)\}\}') +PATTERN = re.compile(r'\{\{(?P<card>.*?)\}\}') CSS_STYLE = 'zindex: 100; position: absolute;' |
