]> git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/models/server.py
Fix broken scoreboard tables for small screen widths
[xonotic/xonstat.git] / xonstat / models / server.py
index 20f8c119475525e994582fffa3b9ce4245e0bce4..387c2cddad37206f2041986593957fd82f64a8ee 100644 (file)
@@ -2,21 +2,21 @@
 Models related to servers.
 """
 
-from calendar import timegm
 from datetime import datetime as dt
 
-from xonstat.util import pretty_date
+from xonstat.models.mixins import FuzzyDateMixin, EpochMixin
 
 
-class Server(object):
+class Server(FuzzyDateMixin, EpochMixin):
     """
     A Xonotic server, identifiable by name and (when there's a conflict) hashkey.
     """
 
-    def __init__(self, name=None, hashkey=None, ip_addr=None):
+    def __init__(self, name=None, hashkey=None, ip_addr=None, elo_ind=None):
         self.name = name
         self.hashkey = hashkey
         self.ip_addr = ip_addr
+        self.elo_ind = elo_ind if elo_ind is not None else True
         self.create_dt = dt.utcnow()
 
     def __repr__(self):
@@ -29,9 +29,3 @@ class Server(object):
             'ip_addr': self.ip_addr,
             'location': self.location,
         }
-
-    def fuzzy_date(self):
-        return pretty_date(self.create_dt)
-
-    def epoch(self):
-        return timegm(self.create_dt.timetuple())
\ No newline at end of file