Add a representation for the submission for debugging. Always add the player if they...
authorAnt Zucaro <azucaro@gmail.com>
Sun, 5 Feb 2017 18:17:47 +0000 (13:17 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 5 Feb 2017 18:17:47 +0000 (13:17 -0500)
xonstat/views/submission.py

index 8a00bc8..89c43d1 100644 (file)
@@ -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."""