From 67d70917ab612acf10c18505d6423e2483249ae5 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 22 Feb 2024 16:57:33 +0100 Subject: Disabling RR prechecks, only enabling checks configured in JSON --- preseason/check-all.sh | 2 +- preseason/checks.py | 21 ++++++++++++++++---- preseason/config/1n.json | 36 ---------------------------------- preseason/config/1n.json-disabled | 36 ++++++++++++++++++++++++++++++++++ preseason/config/1s.json | 36 ---------------------------------- preseason/config/1s.json-disabled | 36 ++++++++++++++++++++++++++++++++++ preseason/config/2ne.json | 36 ---------------------------------- preseason/config/2ne.json-disabled | 36 ++++++++++++++++++++++++++++++++++ preseason/config/2nw.json | 36 ---------------------------------- preseason/config/2nw.json-disabled | 36 ++++++++++++++++++++++++++++++++++ preseason/config/2se.json | 36 ---------------------------------- preseason/config/2se.json-disabled | 36 ++++++++++++++++++++++++++++++++++ preseason/config/2sw.json | 37 ----------------------------------- preseason/config/2sw.json-disabled | 37 +++++++++++++++++++++++++++++++++++ preseason/config/eklasa.json | 32 ------------------------------ preseason/config/eklasa.json-disabled | 32 ++++++++++++++++++++++++++++++ 16 files changed, 267 insertions(+), 254 deletions(-) delete mode 100644 preseason/config/1n.json create mode 100644 preseason/config/1n.json-disabled delete mode 100644 preseason/config/1s.json create mode 100644 preseason/config/1s.json-disabled delete mode 100644 preseason/config/2ne.json create mode 100644 preseason/config/2ne.json-disabled delete mode 100644 preseason/config/2nw.json create mode 100644 preseason/config/2nw.json-disabled delete mode 100644 preseason/config/2se.json create mode 100644 preseason/config/2se.json-disabled delete mode 100644 preseason/config/2sw.json create mode 100644 preseason/config/2sw.json-disabled delete mode 100644 preseason/config/eklasa.json create mode 100644 preseason/config/eklasa.json-disabled (limited to 'preseason') diff --git a/preseason/check-all.sh b/preseason/check-all.sh index ed701d5..8e59189 100755 --- a/preseason/check-all.sh +++ b/preseason/check-all.sh @@ -2,5 +2,5 @@ find config -name *.json | while read JSON do - python3 checks.py ${JSON} dates logoh vp_table page_language team_names kolorki + python3 checks.py ${JSON} round_dates logoh vp_table language team_names kolorki done diff --git a/preseason/checks.py b/preseason/checks.py index 77cc57a..62b9f97 100644 --- a/preseason/checks.py +++ b/preseason/checks.py @@ -28,7 +28,9 @@ def check_round_date(round_no, round_date): round_no, round_date, date_cell[1])) -def check_dates(): +def check_round_dates(): + if 'round_dates' not in config: + return for i in range(0, len(config['round_dates'])): check_round_date(i+1, config['round_dates'][i]) @@ -44,6 +46,8 @@ def print_diff(str_1, str_2): def check_logoh(): + if 'logoh' not in config: + return if 'custom_file' in config['logoh']: html_logoh = get_file(config['logoh']['custom_file'], prefixed=False) else: @@ -56,6 +60,8 @@ def check_logoh(): def check_kolorki(): + if 'kolorki' not in config: + return server_kolorki = get_file('css/kolorki.css', prefixed=False) with io.open('config/' + config['kolorki'], encoding='iso-8859-2') as kolorki_file: template_kolorki = kolorki_file.read() @@ -63,6 +69,8 @@ def check_kolorki(): def check_vp_table(): + if 'vp_table' not in config: + return with open('config/' + config['vp_table']) as vp_file: vp_table = [l.strip().split(' - ') for l in vp_file.readlines() if l.strip()] vp_html = bs(get_file('vptable.html'), 'lxml') @@ -81,7 +89,9 @@ def check_vp_table(): vp_row += 1 -def check_page_language(): +def check_language(): + if 'language' not in config: + return leaderboard = bs(get_file('leaderb.html'), 'lxml') place_str = leaderboard.select('tr > td.bdcc12')[0].text if place_str != config['language']: @@ -135,6 +145,8 @@ def get_html_names(): def check_team_names(): + if 'team_names' not in config: + return cezar_names = get_cezar_names() html_names = get_html_names() for team_id, team_name in cezar_names.items(): @@ -151,5 +163,6 @@ def check_team_names(): print('Checking %s' % (sys.argv[1])) for check in sys.argv[2:]: - print(' ' + check) - globals()['check_' + check]() + if check in config: + print(' ' + check) + globals()['check_' + check]() diff --git a/preseason/config/1n.json b/preseason/config/1n.json deleted file mode 100644 index d9015e8..0000000 --- a/preseason/config/1n.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "source": { - "path": "https://wyniki.pzbs.pl/liga/liga2023-24/1liga/n/", - "prefix": "nrr" - }, - "language": "miejsce", - "vp_table": "24.TVP", - "logoh": { - "template": "logoh.centralne.html", - "variables": { - "prefix": "nrr", - "group": "N", - "level": "1", - "league": "I" - } - }, - "round_dates": [ - "2023-10-07, 10:00", - "2023-10-07, 15:00", - "2023-10-07, 19:30", - "2023-10-08, 09:00", - "2023-10-08, 13:30", - "2023-11-18, 10:00", - "2023-11-18, 15:00", - "2023-11-18, 19:30", - "2023-11-19, 09:00", - "2023-11-19, 13:30", - "2024-01-20, 10:00", - "2024-01-20, 15:00", - "2024-01-20, 19:30", - "2024-01-21, 09:00", - "2024-01-21, 13:30" - ], - "team_names": "../dumps/.cezar-teams-dmp202324_1n", - "kolorki": "kolorki.centralne.css" -} diff --git a/preseason/config/1n.json-disabled b/preseason/config/1n.json-disabled new file mode 100644 index 0000000..d9015e8 --- /dev/null +++ b/preseason/config/1n.json-disabled @@ -0,0 +1,36 @@ +{ + "source": { + "path": "https://wyniki.pzbs.pl/liga/liga2023-24/1liga/n/", + "prefix": "nrr" + }, + "language": "miejsce", + "vp_table": "24.TVP", + "logoh": { + "template": "logoh.centralne.html", + "variables": { + "prefix": "nrr", + "group": "N", + "level": "1", + "league": "I" + } + }, + "round_dates": [ + "2023-10-07, 10:00", + "2023-10-07, 15:00", + "2023-10-07, 19:30", + "2023-10-08, 09:00", + "2023-10-08, 13:30", + "2023-11-18, 10:00", + "2023-11-18, 15:00", + "2023-11-18, 19:30", + "2023-11-19, 09:00", + "2023-11-19, 13:30", + "2024-01-20, 10:00", + "2024-01-20, 15:00", + "2024-01-20, 19:30", + "2024-01-21, 09:00", + "2024-01-21, 13:30" + ], + "team_names": "../dumps/.cezar-teams-dmp202324_1n", + "kolorki": "kolorki.centralne.css" +} diff --git a/preseason/config/1s.json b/preseason/config/1s.json deleted file mode 100644 index 7284094..0000000 --- a/preseason/config/1s.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "source": { - "path": "https://wyniki.pzbs.pl/liga/liga2023-24/1liga/s/", - "prefix": "srr" - }, - "language": "miejsce", - "vp_table": "24.TVP", - "logoh": { - "template": "logoh.centralne.html", - "variables": { - "prefix": "srr", - "group": "S", - "level": "1", - "league": "I" - } - }, - "round_dates": [ - "2023-10-07, 10:00", - "2023-10-07, 15:00", - "2023-10-07, 19:30", - "2023-10-08, 09:00", - "2023-10-08, 13:30", - "2023-11-18, 10:00", - "2023-11-18, 15:00", - "2023-11-18, 19:30", - "2023-11-19, 09:00", - "2023-11-19, 13:30", - "2024-01-20, 10:00", - "2024-01-20, 15:00", - "2024-01-20, 19:30", - "2024-01-21, 09:00", - "2024-01-21, 13:30" - ], - "team_names": "../dumps/.cezar-teams-dmp202324_1s", - "kolorki": "kolorki.centralne.css" -} diff --git a/preseason/config/1s.json-disabled b/preseason/config/1s.json-disabled new file mode 100644 index 0000000..7284094 --- /dev/null +++ b/preseason/config/1s.json-disabled @@ -0,0 +1,36 @@ +{ + "source": { + "path": "https://wyniki.pzbs.pl/liga/liga2023-24/1liga/s/", + "prefix": "srr" + }, + "language": "miejsce", + "vp_table": "24.TVP", + "logoh": { + "template": "logoh.centralne.html", + "variables": { + "prefix": "srr", + "group": "S", + "level": "1", + "league": "I" + } + }, + "round_dates": [ + "2023-10-07, 10:00", + "2023-10-07, 15:00", + "2023-10-07, 19:30", + "2023-10-08, 09:00", + "2023-10-08, 13:30", + "2023-11-18, 10:00", + "2023-11-18, 15:00", + "2023-11-18, 19:30", + "2023-11-19, 09:00", + "2023-11-19, 13:30", + "2024-01-20, 10:00", + "2024-01-20, 15:00", + "2024-01-20, 19:30", + "2024-01-21, 09:00", + "2024-01-21, 13:30" + ], + "team_names": "../dumps/.cezar-teams-dmp202324_1s", + "kolorki": "kolorki.centralne.css" +} diff --git a/preseason/config/2ne.json b/preseason/config/2ne.json deleted file mode 100644 index 0a72dd7..0000000 --- a/preseason/config/2ne.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "source": { - "path": "https://wyniki.pzbs.pl/liga/liga2023-24/2liga/ne/", - "prefix": "nerr" - }, - "language": "miejsce", - "vp_table": "24.TVP", - "logoh": { - "template": "logoh.centralne.html", - "variables": { - "prefix": "nerr", - "group": "NE", - "level": "2", - "league": "II" - } - }, - "round_dates": [ - "07.10.2023, 10:00", - "07.10.2023, 15:00", - "07.10.2023, 19:30", - "08.10.2023, 09:00", - "08.10.2023, 13:30", - "18.11.2023, 10:00", - "18.11.2023, 15:00", - "18.11.2023, 19:30", - "19.11.2023, 09:00", - "19.11.2023, 13:30", - "20.01.2024, 10:00", - "20.01.2024, 15:00", - "20.01.2024, 19:30", - "21.01.2024, 09:00", - "21.01.2024, 13:30" - ], - "team_names": "../dumps/.cezar-teams-dmp202324_2ne", - "kolorki": "kolorki.centralne.css" -} diff --git a/preseason/config/2ne.json-disabled b/preseason/config/2ne.json-disabled new file mode 100644 index 0000000..0a72dd7 --- /dev/null +++ b/preseason/config/2ne.json-disabled @@ -0,0 +1,36 @@ +{ + "source": { + "path": "https://wyniki.pzbs.pl/liga/liga2023-24/2liga/ne/", + "prefix": "nerr" + }, + "language": "miejsce", + "vp_table": "24.TVP", + "logoh": { + "template": "logoh.centralne.html", + "variables": { + "prefix": "nerr", + "group": "NE", + "level": "2", + "league": "II" + } + }, + "round_dates": [ + "07.10.2023, 10:00", + "07.10.2023, 15:00", + "07.10.2023, 19:30", + "08.10.2023, 09:00", + "08.10.2023, 13:30", + "18.11.2023, 10:00", + "18.11.2023, 15:00", + "18.11.2023, 19:30", + "19.11.2023, 09:00", + "19.11.2023, 13:30", + "20.01.2024, 10:00", + "20.01.2024, 15:00", + "20.01.2024, 19:30", + "21.01.2024, 09:00", + "21.01.2024, 13:30" + ], + "team_names": "../dumps/.cezar-teams-dmp202324_2ne", + "kolorki": "kolorki.centralne.css" +} diff --git a/preseason/config/2nw.json b/preseason/config/2nw.json deleted file mode 100644 index bbb279b..0000000 --- a/preseason/config/2nw.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "source": { - "path": "https://wyniki.pzbs.pl/liga/liga2023-24/2liga/nw/", - "prefix": "nwrr" - }, - "language": "miejsce", - "vp_table": "24.TVP", - "logoh": { - "template": "logoh.centralne.html", - "variables": { - "prefix": "nwrr", - "group": "NW", - "level": "2", - "league": "II" - } - }, - "round_dates": [ - "2023-10-07, 10:00", - "2023-10-07, 15:00", - "2023-10-07, 19:30", - "2023-10-08, 09:00", - "2023-10-08, 13:30", - "2023-11-18, 10:00", - "2023-11-18, 15:00", - "2023-11-18, 19:30", - "2023-11-19, 09:00", - "2023-11-19, 13:30", - "2024-01-20, 10:00", - "2024-01-20, 15:00", - "2024-01-20, 19:30", - "2024-01-21, 09:00", - "2024-01-21, 13:30" - ], - "team_names": "../dumps/.cezar-teams-dmp202324_2nw", - "kolorki": "kolorki.centralne.css" -} diff --git a/preseason/config/2nw.json-disabled b/preseason/config/2nw.json-disabled new file mode 100644 index 0000000..bbb279b --- /dev/null +++ b/preseason/config/2nw.json-disabled @@ -0,0 +1,36 @@ +{ + "source": { + "path": "https://wyniki.pzbs.pl/liga/liga2023-24/2liga/nw/", + "prefix": "nwrr" + }, + "language": "miejsce", + "vp_table": "24.TVP", + "logoh": { + "template": "logoh.centralne.html", + "variables": { + "prefix": "nwrr", + "group": "NW", + "level": "2", + "league": "II" + } + }, + "round_dates": [ + "2023-10-07, 10:00", + "2023-10-07, 15:00", + "2023-10-07, 19:30", + "2023-10-08, 09:00", + "2023-10-08, 13:30", + "2023-11-18, 10:00", + "2023-11-18, 15:00", + "2023-11-18, 19:30", + "2023-11-19, 09:00", + "2023-11-19, 13:30", + "2024-01-20, 10:00", + "2024-01-20, 15:00", + "2024-01-20, 19:30", + "2024-01-21, 09:00", + "2024-01-21, 13:30" + ], + "team_names": "../dumps/.cezar-teams-dmp202324_2nw", + "kolorki": "kolorki.centralne.css" +} diff --git a/preseason/config/2se.json b/preseason/config/2se.json deleted file mode 100644 index ec06609..0000000 --- a/preseason/config/2se.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "source": { - "path": "https://wyniki.pzbs.pl/liga/liga2023-24/2liga/se/", - "prefix": "serr" - }, - "language": "miejsce", - "vp_table": "24.TVP", - "logoh": { - "template": "logoh.centralne.html", - "variables": { - "prefix": "serr", - "group": "SE", - "level": "2", - "league": "II" - } - }, - "round_dates": [ - "2023-10-07, 10:00", - "2023-10-07, 15:00", - "2023-10-07, 19:30", - "2023-10-08, 09:00", - "2023-10-08, 13:30", - "2023-11-18, 10:00", - "2023-11-18, 15:00", - "2023-11-18, 19:30", - "2023-11-19, 09:00", - "2023-11-19, 13:30", - "2024-01-20, 10:00", - "2024-01-20, 15:00", - "2024-01-20, 19:30", - "2024-01-21, 09:00", - "2024-01-21, 13:30" - ], - "team_names": "../dumps/.cezar-teams-dmp202324_2se", - "kolorki": "kolorki.centralne.css" -} diff --git a/preseason/config/2se.json-disabled b/preseason/config/2se.json-disabled new file mode 100644 index 0000000..ec06609 --- /dev/null +++ b/preseason/config/2se.json-disabled @@ -0,0 +1,36 @@ +{ + "source": { + "path": "https://wyniki.pzbs.pl/liga/liga2023-24/2liga/se/", + "prefix": "serr" + }, + "language": "miejsce", + "vp_table": "24.TVP", + "logoh": { + "template": "logoh.centralne.html", + "variables": { + "prefix": "serr", + "group": "SE", + "level": "2", + "league": "II" + } + }, + "round_dates": [ + "2023-10-07, 10:00", + "2023-10-07, 15:00", + "2023-10-07, 19:30", + "2023-10-08, 09:00", + "2023-10-08, 13:30", + "2023-11-18, 10:00", + "2023-11-18, 15:00", + "2023-11-18, 19:30", + "2023-11-19, 09:00", + "2023-11-19, 13:30", + "2024-01-20, 10:00", + "2024-01-20, 15:00", + "2024-01-20, 19:30", + "2024-01-21, 09:00", + "2024-01-21, 13:30" + ], + "team_names": "../dumps/.cezar-teams-dmp202324_2se", + "kolorki": "kolorki.centralne.css" +} diff --git a/preseason/config/2sw.json b/preseason/config/2sw.json deleted file mode 100644 index 178e3c3..0000000 --- a/preseason/config/2sw.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "source": { - "path": "https://wyniki.pzbs.pl/liga/liga2023-24/2liga/sw/", - "prefix": "swrr" - }, - "language": "miejsce", - "vp_table": "24.TVP", - "logoh": { - "custom_file": "dmp2swrrlogo.html", - "template": "logoh.centralne.html", - "variables": { - "prefix": "swrr", - "group": "SW", - "level": "2", - "league": "II" - } - }, - "round_dates": [ - "2023-10-07, 10:00", - "2023-10-07, 15:00", - "2023-10-07, 19:30", - "2023-10-08, 09:00", - "2023-10-08, 13:30", - "2023-11-18, 10:00", - "2023-11-18, 15:00", - "2023-11-18, 19:30", - "2023-11-19, 09:00", - "2023-11-19, 13:30", - "2024-01-20, 10:00", - "2024-01-20, 15:00", - "2024-01-20, 19:30", - "2024-01-21, 09:00", - "2024-01-21, 13:30" - ], - "team_names": "../dumps/.cezar-teams-dmp202324_2sw", - "kolorki": "kolorki.centralne.css" -} diff --git a/preseason/config/2sw.json-disabled b/preseason/config/2sw.json-disabled new file mode 100644 index 0000000..178e3c3 --- /dev/null +++ b/preseason/config/2sw.json-disabled @@ -0,0 +1,37 @@ +{ + "source": { + "path": "https://wyniki.pzbs.pl/liga/liga2023-24/2liga/sw/", + "prefix": "swrr" + }, + "language": "miejsce", + "vp_table": "24.TVP", + "logoh": { + "custom_file": "dmp2swrrlogo.html", + "template": "logoh.centralne.html", + "variables": { + "prefix": "swrr", + "group": "SW", + "level": "2", + "league": "II" + } + }, + "round_dates": [ + "2023-10-07, 10:00", + "2023-10-07, 15:00", + "2023-10-07, 19:30", + "2023-10-08, 09:00", + "2023-10-08, 13:30", + "2023-11-18, 10:00", + "2023-11-18, 15:00", + "2023-11-18, 19:30", + "2023-11-19, 09:00", + "2023-11-19, 13:30", + "2024-01-20, 10:00", + "2024-01-20, 15:00", + "2024-01-20, 19:30", + "2024-01-21, 09:00", + "2024-01-21, 13:30" + ], + "team_names": "../dumps/.cezar-teams-dmp202324_2sw", + "kolorki": "kolorki.centralne.css" +} diff --git a/preseason/config/eklasa.json b/preseason/config/eklasa.json deleted file mode 100644 index 8af4a23..0000000 --- a/preseason/config/eklasa.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "source": { - "path": "https://wyniki.pzbs.pl/liga/liga2023-24/ekstraklasa/", - "prefix": "rr" - }, - "language": "place", - "vp_table": "24.TVP", - "logoh": { - "template": "logoh.eklasa.html", - "variables": { - } - }, - "round_dates": [ - "2023-10-06, 15:00", - "2023-10-06, 19:30", - "2023-10-07, 10:00", - "2023-10-07, 15:00", - "2023-10-07, 19:30", - "2023-10-08, 09:00", - "2023-10-08, 13:30", - "2024-01-05, 10:00", - "2024-01-05, 15:00", - "2024-01-05, 19:30", - "2024-01-06, 10:00", - "2024-01-06, 15:00", - "2024-01-06, 19:30", - "2024-01-07, 09:00", - "2024-01-07, 13:30" - ], - "team_names": "../dumps/.cezar-teams-dmp202324_e", - "kolorki": "kolorki.ekstraklasa.css" -} diff --git a/preseason/config/eklasa.json-disabled b/preseason/config/eklasa.json-disabled new file mode 100644 index 0000000..8af4a23 --- /dev/null +++ b/preseason/config/eklasa.json-disabled @@ -0,0 +1,32 @@ +{ + "source": { + "path": "https://wyniki.pzbs.pl/liga/liga2023-24/ekstraklasa/", + "prefix": "rr" + }, + "language": "place", + "vp_table": "24.TVP", + "logoh": { + "template": "logoh.eklasa.html", + "variables": { + } + }, + "round_dates": [ + "2023-10-06, 15:00", + "2023-10-06, 19:30", + "2023-10-07, 10:00", + "2023-10-07, 15:00", + "2023-10-07, 19:30", + "2023-10-08, 09:00", + "2023-10-08, 13:30", + "2024-01-05, 10:00", + "2024-01-05, 15:00", + "2024-01-05, 19:30", + "2024-01-06, 10:00", + "2024-01-06, 15:00", + "2024-01-06, 19:30", + "2024-01-07, 09:00", + "2024-01-07, 13:30" + ], + "team_names": "../dumps/.cezar-teams-dmp202324_e", + "kolorki": "kolorki.ekstraklasa.css" +} -- cgit v1.2.3