1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 00:28:20 +08:00

Fix: Redundant template-maa.maa.json config file (#2551)

This commit is contained in:
hgjazhgj
2023-05-05 13:29:53 +09:00
committed by GitHub
parent f2e88d8e47
commit b18be2ae2b
6 changed files with 19 additions and 12 deletions

View File

@@ -957,16 +957,19 @@ class AlasGUI(Frame):
def add():
name = pin["AddAlas_name"]
origin = pin["AddAlas_copyfrom"]
if set(name) & set(".\\/:*?\"'<>|"):
clear(s)
put(name, origin)
put_error(t("Gui.AddAlas.InvalidChar"), scope=s)
return
if name in alas_instance():
err="Gui.AddAlas.FileExist"
elif set(name) & set(".\\/:*?\"'<>|"):
err="Gui.AddAlas.InvalidChar"
elif name.lower().startswith("template"):
err="Gui.AddAlas.InvalidPrefixTemplate"
else:
err=""
if err:
clear(s)
put(name, origin)
put_error(t("Gui.AddAlas.FileExist"), scope=s)
put_error(t(err), scope=s)
return
r = load_config(origin).read_file(origin)