summaryrefslogtreecommitdiff
path: root/preseason/checks.py
diff options
context:
space:
mode:
Diffstat (limited to 'preseason/checks.py')
-rw-r--r--preseason/checks.py21
1 files changed, 17 insertions, 4 deletions
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]()