implement simple rounds display

This commit is contained in:
Yannik Schmidt
2020-09-29 07:37:53 +02:00
parent 602668f9d0
commit a630cddb13
4 changed files with 116 additions and 0 deletions

22
Round.py Normal file
View File

@@ -0,0 +1,22 @@
import json
import datetime
class Round:
def __init__(self, dbRow):
'''Create Round Object from cursor database row'''
timestamp, winners, losers, winnerSide, mapName, duration, prediction, confidence = dbRow
startTime = datetime.datetime.fromtimestamp(int(float(timestamp)))
winnersParsed = json.loads(winners)
losersParsed = json.loads(losers)
self.startTime = startTime
self.winners = winners
self.losers = losers
self.winnerSide = winnerSide
if winnerSide == 2:
self.winnerSideString = "Insurgent"
else:
self.winnerSideString = "Security"
self.mapName = mapName
self.duration = datetime.timedelta(seconds=int(duration))