mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-21 02:07:06 +02:00
remove unused code
This commit is contained in:
1 parent
87d8b9a19d
commit
d29f092bff
1 file changed
+49
-49
+49
-49
@@ -309,60 +309,60 @@ async def replayWorker(
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def getTitle_old(replayfile: str, title: str, i: int) -> str:
|
# def getTitle_old(replayfile: str, title: str, i: int) -> str:
|
||||||
global wg
|
# global wg
|
||||||
|
|
||||||
if title is None:
|
# if title is None:
|
||||||
try:
|
# try:
|
||||||
filename = os.path.basename(replayfile)
|
# filename = os.path.basename(replayfile)
|
||||||
bu.debug(filename)
|
# bu.debug(filename)
|
||||||
map_usrStrs = wg.get_map_user_strs()
|
# map_usrStrs = wg.get_map_user_strs()
|
||||||
tank_userStrs = wg.get_tank_user_strs()
|
# tank_userStrs = wg.get_tank_user_strs()
|
||||||
|
|
||||||
# p = re.compile('\\d{8}_\\d{4}_(.+)_(' + '|'.join(map_usrStrs) + ')(?:-\\d)?\\.wotbreplay$')
|
# # p = re.compile('\\d{8}_\\d{4}_(.+)_(' + '|'.join(map_usrStrs) + ')(?:-\\d)?\\.wotbreplay$')
|
||||||
# update 6.2 changed the file name format. Bug fixed 2019-09-09 Jylpah
|
# # update 6.2 changed the file name format. Bug fixed 2019-09-09 Jylpah
|
||||||
p = re.compile(
|
# p = re.compile(
|
||||||
"\\d{8}_\\d{4}_.*?("
|
# "\\d{8}_\\d{4}_.*?("
|
||||||
+ "|".join(tank_userStrs)
|
# + "|".join(tank_userStrs)
|
||||||
+ ")_("
|
# + ")_("
|
||||||
+ "|".join(map_usrStrs)
|
# + "|".join(map_usrStrs)
|
||||||
+ ")(?:-\\d)?\\.wotbreplay$"
|
# + ")(?:-\\d)?\\.wotbreplay$"
|
||||||
)
|
# )
|
||||||
|
|
||||||
m = p.match(filename)
|
# m = p.match(filename)
|
||||||
if m is not None:
|
# if m is not None:
|
||||||
if wg.tanks is not None:
|
# if wg.tanks is not None:
|
||||||
tank = m.group(1)
|
# tank = m.group(1)
|
||||||
if tank in wg.tanks["userStr"]:
|
# if tank in wg.tanks["userStr"]:
|
||||||
tank = wg.tanks["userStr"][tank]
|
# tank = wg.tanks["userStr"][tank]
|
||||||
else:
|
# else:
|
||||||
bu.error(
|
# bu.error(
|
||||||
'Tank code: "'
|
# 'Tank code: "'
|
||||||
+ tank
|
# + tank
|
||||||
+ '" not found from Tankopedia (tanks.json)'
|
# + '" not found from Tankopedia (tanks.json)'
|
||||||
)
|
# )
|
||||||
else:
|
# else:
|
||||||
tank = m.group(1)
|
# tank = m.group(1)
|
||||||
blitz_map = m.group(2)
|
# blitz_map = m.group(2)
|
||||||
if blitz_map in wg.maps:
|
# if blitz_map in wg.maps:
|
||||||
blitz_map = wg.maps[blitz_map]
|
# blitz_map = wg.maps[blitz_map]
|
||||||
else:
|
# else:
|
||||||
bu.error(
|
# bu.error(
|
||||||
'Mapcode: "'
|
# 'Mapcode: "'
|
||||||
+ blitz_map
|
# + blitz_map
|
||||||
+ '" not found from map database (maps.json)'
|
# + '" not found from map database (maps.json)'
|
||||||
)
|
# )
|
||||||
title = tank + " @ " + blitz_map
|
# title = tank + " @ " + blitz_map
|
||||||
else:
|
# else:
|
||||||
title = re.sub("\\.wotbreplay$", "", filename)
|
# title = re.sub("\\.wotbreplay$", "", filename)
|
||||||
except Exception as err:
|
# except Exception as err:
|
||||||
bu.error(err)
|
# bu.error(err)
|
||||||
else:
|
# else:
|
||||||
title.replace("NN", str(i))
|
# title.replace("NN", str(i))
|
||||||
return title
|
# return title
|
||||||
|
|
||||||
|
|
||||||
def getTitle(replayfile: str, title: str = None, i: int = 0) -> str:
|
def getTitle(replayfile: str, title: str | None = None, i: int = 0) -> str:
|
||||||
global wg
|
global wg
|
||||||
assert wg is not None, "wg must not be None"
|
assert wg is not None, "wg must not be None"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user