summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2024-02-22 16:57:33 +0100
committeremkael <emkael@tlen.pl>2024-02-22 16:57:33 +0100
commit67d70917ab612acf10c18505d6423e2483249ae5 (patch)
tree3761a7f5d38df354ef098b76b1a4b337e5efdc4c
parent1a2c6c59f8e2b795c878a748027b87789861116e (diff)
Disabling RR prechecks, only enabling checks configured in JSON
-rw-r--r--Makefile2
-rwxr-xr-xpreseason/check-all.sh2
-rw-r--r--preseason/checks.py21
-rw-r--r--preseason/config/1n.json-disabled (renamed from preseason/config/1n.json)0
-rw-r--r--preseason/config/1s.json-disabled (renamed from preseason/config/1s.json)0
-rw-r--r--preseason/config/2ne.json-disabled (renamed from preseason/config/2ne.json)0
-rw-r--r--preseason/config/2nw.json-disabled (renamed from preseason/config/2nw.json)0
-rw-r--r--preseason/config/2se.json-disabled (renamed from preseason/config/2se.json)0
-rw-r--r--preseason/config/2sw.json-disabled (renamed from preseason/config/2sw.json)0
-rw-r--r--preseason/config/eklasa.json-disabled (renamed from preseason/config/eklasa.json)0
10 files changed, 19 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 45e59f1..ef2c7ed 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ pull:
autocommit: pull
@cd http && git diff --quiet || (date && git gc --quiet && git add . && git commit -m 'Autocommit' && GIT_SSH_COMMAND="ssh ${LIGA_SSH_OPTS}" git push -q)
-preseason: FORCE
+prechecks: FORCE
@cd preseason && ./check-all.sh
players: FORCE
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-disabled
index d9015e8..d9015e8 100644
--- a/preseason/config/1n.json
+++ b/preseason/config/1n.json-disabled
diff --git a/preseason/config/1s.json b/preseason/config/1s.json-disabled
index 7284094..7284094 100644
--- a/preseason/config/1s.json
+++ b/preseason/config/1s.json-disabled
diff --git a/preseason/config/2ne.json b/preseason/config/2ne.json-disabled
index 0a72dd7..0a72dd7 100644
--- a/preseason/config/2ne.json
+++ b/preseason/config/2ne.json-disabled
diff --git a/preseason/config/2nw.json b/preseason/config/2nw.json-disabled
index bbb279b..bbb279b 100644
--- a/preseason/config/2nw.json
+++ b/preseason/config/2nw.json-disabled
diff --git a/preseason/config/2se.json b/preseason/config/2se.json-disabled
index ec06609..ec06609 100644
--- a/preseason/config/2se.json
+++ b/preseason/config/2se.json-disabled
diff --git a/preseason/config/2sw.json b/preseason/config/2sw.json-disabled
index 178e3c3..178e3c3 100644
--- a/preseason/config/2sw.json
+++ b/preseason/config/2sw.json-disabled
diff --git a/preseason/config/eklasa.json b/preseason/config/eklasa.json-disabled
index 8af4a23..8af4a23 100644
--- a/preseason/config/eklasa.json
+++ b/preseason/config/eklasa.json-disabled