From 5b6fc88942c426e12705724303ea90c9a330183f Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sun, 5 Feb 2017 13:17:47 -0500 Subject: [PATCH] Add a representation for the submission for debugging. Always add the player if they are a human or not. --- xonstat/views/submission.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 8a00bc8..89c43d1 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -192,8 +192,8 @@ class Submission(object): elif played and not human: self.bots.append(player) - else: - self.players.append(player) + + self.players.append(player) def parse_team(self, key, tid): """Construct a team events listing from the submission.""" @@ -244,6 +244,12 @@ class Submission(object): return self + def __repr__(self): + """Debugging representation of a submission.""" + return "game_type_cd: {}, mod: {}, players: {}, humans: {}, bots: {}, weapons: {}".format( + self.game_type_cd, self.mod, len(self.players), len(self.humans), len(self.bots), + self.weapons) + def elo_submission_category(submission): """Determines the Elo category purely by what is in the submission data.""" -- 2.39.2