From: Ant Zucaro Date: Mon, 7 Nov 2016 19:38:37 +0000 (-0500) Subject: Fix imports. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c9a245ce2fcfda823110e1e9ff50b5dbc2625336;p=xonotic%2Fxonstat.git Fix imports. --- 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,