diff --git a/main.py b/main.py index 50a51e1a..6cb5c479 100644 --- a/main.py +++ b/main.py @@ -365,11 +365,11 @@ def check_file(): # 检查是否有banlist.py,如果没有就把banlist-template.py复制一份 if not os.path.exists('banlist.py'): - shutil.copy('banlist-template.py', 'banlist.py') + shutil.copy('res/templates/banlist-template.py', 'banlist.py') # 检查是否有sensitive.json if not os.path.exists("sensitive.json"): - shutil.copy("sensitive-template.json", "sensitive.json") + shutil.copy("res/templates/sensitive-template.json", "sensitive.json") # 检查是否有scenario/default.json if not os.path.exists("scenario/default.json"): @@ -377,7 +377,7 @@ def check_file(): # 检查cmdpriv.json if not os.path.exists("cmdpriv.json"): - shutil.copy("cmdpriv-template.json", "cmdpriv.json") + shutil.copy("res/templates/cmdpriv-template.json", "cmdpriv.json") # 检查temp目录 if not os.path.exists("temp/"): diff --git a/res/scripts/generate_cmdpriv_template.py b/res/scripts/generate_cmdpriv_template.py index 45ff0b39..6087a641 100644 --- a/res/scripts/generate_cmdpriv_template.py +++ b/res/scripts/generate_cmdpriv_template.py @@ -13,5 +13,5 @@ for key in cmdsmgr.__command_list__: template[key] = cmdsmgr.__command_list__[key]['privilege'] # 写入cmdpriv-template.json -with open('../../cmdpriv-template.json', 'w') as f: +with open('../templates/cmdpriv-template.json', 'w') as f: f.write(json.dumps(template, indent=4, ensure_ascii=False)) \ No newline at end of file diff --git a/banlist-template.py b/res/templates/banlist-template.py similarity index 100% rename from banlist-template.py rename to res/templates/banlist-template.py diff --git a/cmdpriv-template.json b/res/templates/cmdpriv-template.json similarity index 100% rename from cmdpriv-template.json rename to res/templates/cmdpriv-template.json diff --git a/sensitive-template.json b/res/templates/sensitive-template.json similarity index 100% rename from sensitive-template.json rename to res/templates/sensitive-template.json