From 44a236cbb1b1e5789e97c91c43cbd1070aa447c1 Mon Sep 17 00:00:00 2001 From: xgui4 <134389196+xgui4@users.noreply.github.com> Date: Fri, 17 Apr 2026 01:00:56 -0400 Subject: [PATCH] bump version to 26.4.17a1 and update CLI interface to accept additional parameters --- default.lce_inst | 15 +++++++++++++++ pyproject.toml | 4 ++-- src/lce_qt_launcher/__init__.py | 6 +++--- src/lce_qt_launcher/features.py | 4 ++-- src/lce_qt_launcher/managers/system_manager.py | 11 +++++++---- src/lce_qt_launcher/views/cli.py | 10 +++++++++- src/lce_qt_launcher/views/cmd_arg.py | 4 +++- src/main.py | 4 ++-- 8 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 default.lce_inst diff --git a/default.lce_inst b/default.lce_inst new file mode 100644 index 0000000..e54a3f8 --- /dev/null +++ b/default.lce_inst @@ -0,0 +1,15 @@ +{ + "name": "Default Managed", + "installation_path": "/home/xgui4/Documents/LegacyClient", + "username": "Xgui4", + "archive_file": "LCEWindows64.zip", + "exe_name": "Minecraft.Client.exe", + "repo_url": "https://github.com/MCLCE/MinecraftConsoles", + "instance_source": "InstanceSource.GITHUB_RELEASE", + "instance_type": "InstanceType.CLIENT_VANILLA", + "image": [":/assets/minecraft.png"], + "news_feed": "https://github.com/MCLCE/minecraftconsoles/commits", + "version": "nightly", + "skin_path": "", + "servers": "" +} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b92dcd5..9ec9817 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "LCE-Qt-Launcher" -version = "26.4.16a1" +version = "26.4.17a1" description = "This is a custom Free/Libre Minecraft LCE Launcher written in Python and Qt. (Nighly Build)" requires-python = ">3.10, <3.13" license = "GPL-3.0-or-later" @@ -30,7 +30,7 @@ path = "hatch_build.py" [tool.hatch.envs.default.scripts] packages = "python packages.py" -run-app = "run.py" +run-app = "python run.py" [tool.hatch.build] artifacts = [ diff --git a/src/lce_qt_launcher/__init__.py b/src/lce_qt_launcher/__init__.py index 2c43ae5..1dcfda8 100644 --- a/src/lce_qt_launcher/__init__.py +++ b/src/lce_qt_launcher/__init__.py @@ -1,7 +1,7 @@ from enum import StrEnum _FALLBACK_APP_NAME = "Minecraft LCE QT Launcher" -_FALLBACK_VERSION_NUMBER = "26.4.16a1" +_FALLBACK_VERSION_NUMBER = "26.4.17a1" _FALLBACK_LICENSE = "GPLv3" _FALLBACK_LICENSE_LINK = "https://www.gnu.org/licenses/gpl-3.0" _FALLBACK_GIT_REPO_URL = "https://github.com/xgui4/LCE-QT-Launcher" @@ -12,7 +12,7 @@ _INSTANCE_EXTENSION = ".lce_inst" class Languages(StrEnum): FALLBACK = "translations.json" ENGLISH = "en", - FRENCH = "fr", + FRENCH = "fr" license_str = """ # GNU GENERAL PUBLIC LICENSE @@ -647,7 +647,7 @@ attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - + This is a custom Minecraft LCE Launcher written in Python and Qt with Freedom and with GNU/Linux support in mind. Copyright (C) 2026 Xgui4 This program is free software: you can redistribute it and/or modify diff --git a/src/lce_qt_launcher/features.py b/src/lce_qt_launcher/features.py index 2eba70a..09eda00 100644 --- a/src/lce_qt_launcher/features.py +++ b/src/lce_qt_launcher/features.py @@ -112,8 +112,8 @@ def save_instance(parent : QWidget, instanceManager : InstanceManager, buildInf file_name: str = QFileDialog.getSaveFileName(parent, "Set the instance save file path to saved", f"{buildInfo.system_manager.found_default_save_path }(\"LCE Instance Save File\" (*{buildInfo.instance_extension}))")[0] instanceManager.save_instance(file_name) -def launch_cli_interface(instance_man : InstanceManager): - cli.launch_cli(instance_man) +def launch_cli_interface(instance_man : InstanceManager, buildInfo : BuildInfo, argv : list): + cli.launch_cli(instance_man, buildInfo, argv) def generate_user_config(userPref : UserPref): userPref.generate_default_config() diff --git a/src/lce_qt_launcher/managers/system_manager.py b/src/lce_qt_launcher/managers/system_manager.py index aff8793..191db85 100644 --- a/src/lce_qt_launcher/managers/system_manager.py +++ b/src/lce_qt_launcher/managers/system_manager.py @@ -59,13 +59,16 @@ class SystemManager(): if os.name == "nt": os.environ["QT_QPA_PLATFORM"] = "windows:darkmode=2" - def set_file_permission(self, file_abs_path : str) -> str: - """https://stackoverflow.com/questions/12791997/how-do-you-do-a-simple-chmod-x-from-within-python""" - if [os.name == "posix"]: + def set_file_permission(self, file_abs_path: str) -> str: + """Makes the file executable on POSIX systems.""" + if os.name == "posix": st = os.stat(file_abs_path) - os.chmod(file_abs_path, st.st_mode | st.S_IEXEC) + os.chmod(file_abs_path, st.st_mode | stat.S_IEXEC) + return "Permissions updated." else: + # term_service doit être défini dans votre contexte term_service.information("No POSIX system detected, skipping file permission management.") + return "Non POSIX System." def found_default_save_path(self) -> str: return os.path.join(pathlib.Path.home(), "lce-qt-launcher") diff --git a/src/lce_qt_launcher/views/cli.py b/src/lce_qt_launcher/views/cli.py index 0d6e354..3b8286f 100644 --- a/src/lce_qt_launcher/views/cli.py +++ b/src/lce_qt_launcher/views/cli.py @@ -9,8 +9,16 @@ def launch_cli(instance_man : InstanceManager, build_info : BuildInfo, argv : se 3. [bold red] Others : Coming Soon ! [/bold red] """ term_service.print_warning("CLI mode is currently untested and might be working correctly and will be reworked soon.") - term_service.print_pretty(build_info.app_name) + term_service.print_pretty(""" +LCE Qt Launcher Copyright (C) 2026 Xgui4 +This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. +""") term_service.print_pretty(MENU_STR) + + user_output: str = input() + if len(argv) < 1: user_output: str = input() if user_output == "1" or argv[1] == "play": diff --git a/src/lce_qt_launcher/views/cmd_arg.py b/src/lce_qt_launcher/views/cmd_arg.py index 224e495..3608571 100644 --- a/src/lce_qt_launcher/views/cmd_arg.py +++ b/src/lce_qt_launcher/views/cmd_arg.py @@ -5,6 +5,8 @@ from lce_qt_launcher.app_context import AppContext import lce_qt_launcher.views.term_service as term_service import lce_qt_launcher.features as features +import sys + class CmdArgAction(Enum): GEN_CONFIG = 0 PRINT_VERSION = 1 @@ -69,7 +71,7 @@ def launch_cmd_action(action : CmdArgAction, appContext : AppContext): elif action == CmdArgAction.PRINT_VERSION: features.display_version(appContext.buildInfo) elif action == CmdArgAction.CLI_VERSION: - features.launch_cli_interface(appContext.instanceManager) + features.launch_cli_interface(appContext.instanceMan, appContext.buildInfo, sys.argv) elif action == CmdArgAction.CLI_VERSION: term_service.print_warning("Not Implemented Yet!") else: diff --git a/src/main.py b/src/main.py index a03bd5d..9a25ee5 100755 --- a/src/main.py +++ b/src/main.py @@ -7,8 +7,8 @@ # nuitka-project: --include-data-dir=data=data # nuitka-project: --include-qt-plugins=sensible # nuitka-project: --windows-console-mode=force -# nuitka-project: --product-version="0.26.4.16" -# nuitka-project: --file-version="0.26.4.16" +# nuitka-project: --product-version="0.26.4.17" +# nuitka-project: --file-version="0.26.4.17" # nuitka-project: --file-description="Custom Free/Libre Minecraft LCE Launcher (Nightly)" # nuitka-projet: --include-distribution-metadata=lce-qt-launcher # nuitka-project: --copyright="Copyleft Xgui4 2026 (GPLv3)"