Formatting changes

This commit is contained in:
Jylpah committed 2018-12-15 14:12:12 +02:00
1 parent 6512700ac0
commit 163bda02ef
1 file changed
+4 -2
+4 -2
View File
@@ -381,8 +381,7 @@ def calcTeamStats(result_list: list, player_stats : dict, account_id: int) -> l
n_allies = collections.defaultdict(defaultvalueZero) n_allies = collections.defaultdict(defaultvalueZero)
allies_stats = collections.defaultdict(defaultvalueZero) allies_stats = collections.defaultdict(defaultvalueZero)
for ally in result['allies']: for ally in result['allies']:
if (account_id != None) and (ally == account_id): # Player itself is not in 'allies': see readReplayJSON()
continue
for stat in stat_types: for stat in stat_types:
if player_stats[ally][stat] != None: if player_stats[ally][stat] != None:
allies_stats[stat] += player_stats[ally][stat] allies_stats[stat] += player_stats[ally][stat]
@@ -415,10 +414,13 @@ async def statWorker(queue : asyncio.Queue, workerID: int) -> list:
stats = {} stats = {}
try: try:
i = 0
while True: while True:
# item = await queue.get_nowait() # item = await queue.get_nowait()
item = await queue.get() item = await queue.get()
try: try:
i = (i+1) % 10
if i == 0 :
bu.printWaiter() bu.printWaiter()
acc, tank = item.split(':') acc, tank = item.split(':')
account_id = int(acc) account_id = int(acc)