From c9a245ce2fcfda823110e1e9ff50b5dbc2625336 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 7 Nov 2016 14:38:37 -0500 Subject: [PATCH] Fix imports. --- xonstat/elo.py | 6 ++++-- xonstat/views/submission.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xonstat/elo.py b/xonstat/elo.py index 01a1e8a..bc0c332 100644 --- a/xonstat/elo.py +++ b/xonstat/elo.py @@ -96,10 +96,12 @@ class EloProcessor: # used to determine if a pgstat record is elo-eligible def elo_eligible(pgs): - return pgs.player_id > 2 and pgs.alivetime > timedelta(seconds=0) + return pgs.player_id > 2 and pgs.alivetime > datetime.timedelta(seconds=0) + + elostats = filter(elo_eligible, pgstats) # only process elos for elo-eligible players - for pgstat in filter(elo_eligible, pgstats): + for pgstat in elostats: self.wip[pgstat.player_id] = EloWIP(pgstat.player_id, pgstat) # determine duration from the maximum alivetime diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 74e2d3c..8e39017 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -1,3 +1,4 @@ +import calendar import datetime import logging import re @@ -958,7 +959,7 @@ def submit_stats(request): request.response.content_type = 'text/plain' return { - "now" : timegm(datetime.datetime.utcnow().timetuple()), + "now" : calendar.timegm(datetime.datetime.utcnow().timetuple()), "server" : server, "game" : game, "gmap" : gmap, -- 2.39.2