From 6b8c1209b79702a48ae56bd71249c3312d14f085 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Thu, 6 Apr 2023 17:23:30 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=95=B4=E7=90=86=E6=A0=B9=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 +++--- res/scripts/generate_cmdpriv_template.py | 2 +- banlist-template.py => res/templates/banlist-template.py | 0 .../templates/cmdpriv-template.json | 0 .../templates/sensitive-template.json | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename banlist-template.py => res/templates/banlist-template.py (100%) rename cmdpriv-template.json => res/templates/cmdpriv-template.json (100%) rename sensitive-template.json => res/templates/sensitive-template.json (100%) 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