-
Notifications
You must be signed in to change notification settings - Fork 0
/
runner.py
30 lines (20 loc) · 908 Bytes
/
runner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import json
from inc.http.GridRivalClient import GridRivalClient
from GridRivalFactory import GridRivalFactory
from GridRival import GridRival
loginData = json.load(open('login.json'))
client = GridRivalClient(loginData['username'], loginData['password'])
gridRivalFactory = GridRivalFactory(client)
gridRivalFactory.load()
gridRival:GridRival = gridRivalFactory.getGridRival()
roundScores = gridRival.calculateRoundScore(1)
orderRoundScores = {k: v for k, v in sorted(roundScores.items(), key=lambda item: item[1], reverse=True)}
print("Round score")
for name in orderRoundScores:
print(name, ":", orderRoundScores[name])
print("")
totalScores = gridRival.calculateTotalScoreMidRound(1)
orderTotalScores = {k: v for k, v in sorted(totalScores.items(), key=lambda item: item[1], reverse=True)}
print("Total Scores")
for name in orderTotalScores:
print(name, ":", orderTotalScores[name])