Skip to content

Commit 2a8ddd3

Browse files
committed
BF: CI was still trying to fetch the timeout errors from the db
1 parent ab0f069 commit 2a8ddd3

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

contrib/ci_engine.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,12 @@ def get_errorcount(self, p_name):
407407
408408
Returns
409409
-------
410-
error_count, fatalerror_count : int
410+
fatalerror_count : int
411411
the number of errors for this player
412412
413413
"""
414-
error_count, fatalerror_count = self.dbwrapper.get_errorcount(p_name)
415-
return error_count, fatalerror_count
414+
fatalerror_count = self.dbwrapper.get_errorcount(p_name)
415+
return fatalerror_count
416416

417417
def get_team_name(self, p_name):
418418
"""Get last registered team name.
@@ -479,16 +479,16 @@ def pretty_print_results(self, full=False, team=None, highlight=None, html_expor
479479
result = []
480480
for idx, pname in enumerate(good_players):
481481
win, loss, draw = self.get_results(pname)
482-
error_count, fatalerror_count = self.get_errorcount(pname)
482+
fatalerror_count = self.get_errorcount(pname)
483483
try:
484484
team_name = self.get_team_name(pname)
485485
except ValueError:
486486
team_name = None
487487
score = 0 if (win+loss+draw) == 0 else (win-loss) / (win+loss+draw)
488-
result.append([score, win, draw, loss, pname, team_name, error_count, fatalerror_count])
488+
result.append([score, win, draw, loss, pname, team_name, fatalerror_count])
489489

490490
result.sort(reverse=True)
491-
for [score, win, draw, loss, name, team_name, error_count, fatalerror_count] in result:
491+
for [score, win, draw, loss, name, team_name, fatalerror_count] in result:
492492
style = "bold" if name in highlight else None
493493
display_name = f"{name} ({team_name})" if team_name else f"{name}"
494494
table.add_row(
@@ -499,7 +499,6 @@ def pretty_print_results(self, full=False, team=None, highlight=None, html_expor
499499
f"{loss}",
500500
f"{score:6.3f}",
501501
f"{elo.get(name, 0): >4.0f}",
502-
f"{error_count}",
503502
f"{fatalerror_count}",
504503
style=style,
505504
)
@@ -549,7 +548,7 @@ def batched(iterable, n):
549548

550549
for idx, pname in enumerate(good_players):
551550
win, loss, draw = self.get_results(pname)
552-
error_count, fatalerror_count = self.get_errorcount(pname)
551+
fatalerror_count = self.get_errorcount(pname)
553552
try:
554553
team_name = self.get_team_name(pname)
555554
except ValueError:
@@ -935,7 +934,7 @@ def get_errorcount(self, p1_name):
935934
936935
Returns
937936
-------
938-
error_count, fatalerror_count : errorcount
937+
fatalerror_count : errorcount
939938
"""
940939
self.cursor.execute("""
941940
SELECT sum(fatal_errors) FROM
@@ -956,7 +955,7 @@ def get_errorcount(self, p1_name):
956955
dict(p1=p1_name))
957956
fatal_errorcount = self.cursor.fetchone()
958957

959-
return fatal_errorcount
958+
return fatal_errorcount[0]
960959

961960
def get_wins_losses(self, team=None):
962961
""" Get all wins and losses combined in a table of

0 commit comments

Comments
 (0)