aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2021-10-10 18:15:27 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2021-10-10 18:15:27 +0200
commitcd36afe9e4f194a832c122aa7de835b8a0878fcd (patch)
tree11d2a387a1231f29a5c4f5b4219839daa0944ec9 /scripts
parent14acafb8f746bcbee485959de119a0540e4b1480 (diff)
downloadmuhqs-game-cd36afe9e4f194a832c122aa7de835b8a0878fcd.tar.gz
muhqs-game-cd36afe9e4f194a832c122aa7de835b8a0878fcd.zip
[generate_card.py] assert against useless use of lists
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate_card.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/generate_card.py b/scripts/generate_card.py
index adee5693..8e8f0aa6 100755
--- a/scripts/generate_card.py
+++ b/scripts/generate_card.py
@@ -114,6 +114,7 @@ def get_latex_field(card: MutableMapping,
# Transform a list of values into a single string.
# normal fields are joined using '\\ '
if not has_latex:
+ assert len(normal_value) > 1
return '\\\\ '.join(normal_value), False
# latex_* values are just concatenated.
@@ -121,6 +122,7 @@ def get_latex_field(card: MutableMapping,
# NOTE: it is allowed for a latex_ field to be sparse.
# Missing entries in a latex_ field list are populated from the corrsponding
# entry of the normal field
+ assert len(latex_value) > 1
for i in range(0, len(latex_value)):
if latex_value[i] is None:
latex_value[i] = f'{fmt_prefix}{normal_value[i]}// '