From 662171f10ec89d76c0172d786facd475e03b9841 Mon Sep 17 00:00:00 2001 From: Jylpah Date: Sat, 19 Sep 2020 19:23:40 +0300 Subject: [PATCH] get_tank_name(), get_map_name --- blitzutils.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/blitzutils.py b/blitzutils.py index 728938a..006f5f7 100644 --- a/blitzutils.py +++ b/blitzutils.py @@ -760,15 +760,25 @@ class WG: @classmethod - def get_map(cls, map_str: str) -> str: + def get_map_name(cls, map_str: str) -> str: """Return map name from short map string in replays""" try: return cls.maps[map_str] except: error('Map ' + map_str + ' not found') - return None + return map_str + @classmethod + def get_tank_name(cls, tank_str: str) -> str: + """Return tnak 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_map_user_strs(cls) -> str: return cls.maps.keys()