From 97e1d553b304b51ab35a1016bb023981c4e20cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Bal=C3=A1=C5=BE?= Date: Mon, 8 Jan 2024 23:00:27 +0000 Subject: [PATCH] More precise naboj validator --- modules/naboj/builder/contexts/validators.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/naboj/builder/contexts/validators.py b/modules/naboj/builder/contexts/validators.py index 76327caa..6c946c95 100644 --- a/modules/naboj/builder/contexts/validators.py +++ b/modules/naboj/builder/contexts/validators.py @@ -30,6 +30,10 @@ class NabojValidator(FileSystemValidator): 'intro.jtt': FileOrLink, 'instructions-inner.jtt': FileOrLink, 'evaluators.jtt': FileOrLink, + Optional('instructions-online-inner.md'): FileOrLink, + Optional('pictures'): { + Optional(Regex(r'.*\.png')): FileOrLink, + } } }, 'venues': { @@ -75,6 +79,7 @@ def _check_presence(self, filename, *, optional: bool = False): } lp = len([x for x, y in is_present.items() if y]) + # If there are all files present, we're good, and if this is an optional file, then also if none are present ok = (lp == len(translations)) or (optional and lp == 0) if self.debug or not ok: