Merge pull request #30 from Jylpah/dev

get_map(): renamed, get_tank_name(): add back
This commit is contained in:
Jylpah committed 2020-10-25 16:36:11 +02:00
commit 1c244c8dc2
2 files changed
+11 -1

No files matched your search

+10
View File
@@ -885,6 +885,16 @@ class WG:
return cls.maps.keys()
@classmethod
def get_tank_name(cls, tank_str: str) -> str:
"""Return tank name from short tank string in replays"""
try:
return cls.tanks["userStr"][tank_str]
except:
error('Tank ' + tank_str + ' not found')
return tank_str
@classmethod
def get_tank_user_strs(cls) -> str:
return cls.tanks["userStr"].keys()
+1 -1
View File
@@ -287,7 +287,7 @@ def getTitle(replayfile: str, title: str, i : int) -> str:
metadata_json = json.load(meta)
#player = metadata_json['playerName']
tank = wg.get_tank_name(metadata_json['playerVehicleName'])
map_name = wg.get_map_name(metadata_json['mapName'])
map_name = wg.get_map(metadata_json['mapName'])
bu.debug('Tank: ' + tank + ' Map: ' + map_name)
except Exception as err:
bu.error(exception = err)