mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-21 02:07:06 +02:00
Update blitzutils.py
This commit is contained in:
1 parent
1a7fcffa17
commit
4c517a11c5
1 file changed
+8
-6
+8
-6
@@ -1854,7 +1854,7 @@ class WoTinspector:
|
|||||||
|
|
||||||
class WIReplay:
|
class WIReplay:
|
||||||
|
|
||||||
replayID = 1
|
replayI = 1
|
||||||
STATUS_UNINIT = 'uninitialized'
|
STATUS_UNINIT = 'uninitialized'
|
||||||
STATUS_ERROR = 'error'
|
STATUS_ERROR = 'error'
|
||||||
STATUS_INCOMPLETE = 'teams only'
|
STATUS_INCOMPLETE = 'teams only'
|
||||||
@@ -1868,9 +1868,11 @@ class WIReplay:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def check(cls, replay_json) -> str:
|
def check(cls, replay_json) -> str:
|
||||||
|
status = self.STATUS_ERROR
|
||||||
try:
|
try:
|
||||||
if replay_json == None:
|
if ('status' in json_resp) and (json_resp['status'] == 'ok'):
|
||||||
return self.STATUS_ERROR
|
if get_JSON_value(json_resp, key='data.summary.allies') != None :
|
||||||
|
debug("JSON check OK")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1878,7 +1880,7 @@ class WIReplay:
|
|||||||
debug('Replay JSON check failed', exception=err)
|
debug('Replay JSON check failed', exception=err)
|
||||||
except:
|
except:
|
||||||
debug("Replay JSON check failed: " + str(json_resp))
|
debug("Replay JSON check failed: " + str(json_resp))
|
||||||
return self.STATUS_ERROR
|
return status
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1886,8 +1888,8 @@ class WIReplay:
|
|||||||
def __init__(self, replay_json, player_id : int = None, filename : str = None):
|
def __init__(self, replay_json, player_id : int = None, filename : str = None):
|
||||||
self.player_id = player_id
|
self.player_id = player_id
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.ID = self.replayID
|
self.I = self.replayI
|
||||||
self.replayID += 1
|
self.replayI += 1
|
||||||
self.status = WIReplay.STATUS_UNINIT
|
self.status = WIReplay.STATUS_UNINIT
|
||||||
self.result = dict()
|
self.result = dict()
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in new issue
Block a user