From 2a2aa95e622d3acb544a04564a135c3b96ec1452 Mon Sep 17 00:00:00 2001 From: LiveInGround <129398571+LiveInGround@users.noreply.github.com> Date: Sun, 17 Aug 2025 10:49:22 +0200 Subject: [PATCH 1/2] Starting update_start_py changes --- .github/update_start_py.py | 46 +++++++++++++++----------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/.github/update_start_py.py b/.github/update_start_py.py index df3fe5a..dd4a09f 100644 --- a/.github/update_start_py.py +++ b/.github/update_start_py.py @@ -1,37 +1,27 @@ +exit() # temp import os -FILES = ["config.json", "ops.json", "pluginapi.py", "main.py", "eula.txt", "LICENSE.md", "banned-ips.json", - "banned-players.json", "server-icon.png", "whitelist.json", "SECURITY.md", - "README.md", "requirements.txt", "utils/plugins/BeaconMCPlugin.py", "utils/locale/en_us.json", - "utils/locale/fr_fr.json", "utils/locale/es.json", "libs/crash_gen.py", "libs/mojangapi.py", - "libs/cryptography_system/system.py"] +IGNORED_FOLDERS = [".github", ".vscode", "LIBS_TO_REUSE_FOR_DEPLOYMENT", "worlds", "plugins"] +IGNORED_FILES = ["start.py", "dev_notes.txt", ".gitignore"] + +files = [] +for root, dirs, filenames in os.walk(os.path.dirname(__file__)): + dirs[:] = [d for d in dirs if d not in IGNORED_FOLDERS] + + for filename in filenames: + if filename in IGNORED_FILES: + continue + files.append(os.path.join(root, filename)) + -files_content = { - "main.py": open("main.py").read(), - "pluginapi.py": open("pluginapi.py").read(), - "config.json": open("config.json").read(), - "ops.json": open("ops.json").read(), - "eula.txt": open("eula.txt").read(), - "LICENSE.md": open("LICENSE.md").read(), - "banned-ips.json": open("banned-ips.json").read(), - "banned-players.json": open("banned-players.json").read(), - "server-icon.png": open("server-icon.png", "rb").read(), # Fichier binaire - "whitelist.json": open("whitelist.json").read(), - "SECURITY.md": open("SECURITY.md").read(), - "README.md": open("README.md").read(), - "requirements.txt": open("requirements.txt").read(), - "utils/plugins/BeaconMCPlugin.py": open("utils/plugins/BeaconMCPlugin.py").read(), - "utils/locale/en_us.json": open("utils/locale/en_us.json").read(), - "utils/locale/fr_fr.json": open("utils/locale/fr_fr.json").read(), - "utils/locale/es.json": open("utils/locale/es.json").read(), - "libs/crash_gen.py": open("libs/crash_gen.py").read(), - "libs/mojangapi.py": open("libs/mojangapi.py").read(), - "libs/cryptography_system/system.py": open("libs/cryptography_system/system.py").read() -} +file_content = {} +for file in files: + with open(file, "r") as f: + file_content[file] = f.read() dico = "{\n" -for f in FILES: +for f in files: # Utilisation de repr() pour échapper correctement les chaînes et éviter les erreurs avec les guillemets triples dico += f' "{f}": {repr(files_content[f])}, \n' dico += "}\n" From 8d876d5f09beade5d257700cdb968a6c50b1099e Mon Sep 17 00:00:00 2001 From: LiveInGround <129398571+LiveInGround@users.noreply.github.com> Date: Mon, 18 Aug 2025 09:11:11 +0200 Subject: [PATCH 2/2] Update update_start_py.py --- .github/update_start_py.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/update_start_py.py b/.github/update_start_py.py index dd4a09f..4729f37 100644 --- a/.github/update_start_py.py +++ b/.github/update_start_py.py @@ -5,9 +5,10 @@ IGNORED_FILES = ["start.py", "dev_notes.txt", ".gitignore"] files = [] +directories = [] for root, dirs, filenames in os.walk(os.path.dirname(__file__)): dirs[:] = [d for d in dirs if d not in IGNORED_FOLDERS] - + directories = dirs for filename in filenames: if filename in IGNORED_FILES: continue @@ -37,12 +38,9 @@ dico = """ + dico + r""" # Check structure -FILES_TO_CHECK = ["config.json", "ops.json", "pluginapi.py", "main.py", "eula.txt", "LICENSE.md", "banned-ips.json", - "banned-players.json", "server-icon.png", "whitelist.json", "SECURITY.md", - "README.md", "requirements.txt", "utils/plugins/BeaconMCPlugin.py", "utils/locale/en_us.json", - "utils/locale/fr_fr.json", "utils/locale/es.json", "libs/crash_gen.py", "libs/mojangapi.py", - "libs/cryptography_system/system.py"] -FOLDERS_TO_CHECK = ["libs", "libs/cryptography_system", "crash_reports", "logs", "plugins", "utils", "worlds"] +FILES_TO_CHECK = """ + files + """ + +FOLDERS_TO_CHECK = """ + directories + """ state = "_DEFAULT" missing_files = []