From 5c213532ba319ebfe68a79cd7396508c14abebe0 Mon Sep 17 00:00:00 2001 From: rene-d Date: Fri, 2 Feb 2024 17:20:10 +0100 Subject: [PATCH] language filter --- scripts/runall.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/runall.py b/scripts/runall.py index 6194c47..7d1dbd4 100755 --- a/scripts/runall.py +++ b/scripts/runall.py @@ -33,12 +33,14 @@ LANGUAGES = { "Python": "{year}/day{day}/day{day}.py", - # "PyPy": "{year}/day{day}/day{day}.py", + "PyPy": "{year}/day{day}/day{day}.py", "Rust": "{year}/target/release/day{day}", "C": "{year}/build/day{day}_c", "C++": "{year}/build/day{day}_cpp", } +DEFAULT_LANGUAGES = {"Python", "Rust"} + INTERPRETERS = { "Python": "python3", "PyPy": "pypy3", @@ -258,7 +260,12 @@ def run_day( results = set() for lang, pattern in LANGUAGES.items(): - if filter_lang and lang.lower() != filter_lang.lower(): + if filter_lang == "all": + pass + elif filter_lang: + if lang.lower() != filter_lang.lower(): + continue + elif lang not in DEFAULT_LANGUAGES: continue prog = Path(pattern.format(year=year, day=mday))