diff --git a/auto_builder.pyproject.user b/auto_builder.pyproject.user index 37198ca..b98f755 100644 --- a/auto_builder.pyproject.user +++ b/auto_builder.pyproject.user @@ -1,10 +1,10 @@ - + EnvironmentId - {c84d5e35-5621-4e71-b77c-153aba92a261} + {97dcf16a-d9bb-4993-8c63-adbceb69fc43} ProjectExplorer.Project.ActiveTarget @@ -75,7 +75,8 @@ true true Builtin.DefaultTidyAndClazy - 8 + 4 + true @@ -87,29 +88,24 @@ ProjectExplorer.Project.Target.0 Desktop - Desktop - Desktop - {4a966a6e-2dee-4f8f-be39-4ac6b53e4565} + Desktop Qt 6.4.3 MinGW 64-bit + Desktop Qt 6.4.3 MinGW 64-bit + qt.qt6.643.win64_mingw_kit 0 0 0 - /home/jeremy.cotineau/perso/auto_builder + C:\Users\jerem\Documents\wakfu_auto_builder - - true - Python.PysideBuildStep - /home/jeremy.cotineau/.local/bin/pyside6-project - - 1 - Build - Build + 0 + Compiler + Compiler ProjectExplorer.BuildSteps.Build 0 - Clean - Clean + Nettoyer + Nettoyer ProjectExplorer.BuildSteps.Clean 2 @@ -124,8 +120,8 @@ 0 - Deploy - Deploy + Déploiement + Déploiement ProjectExplorer.BuildSteps.Deploy 1 @@ -141,15 +137,16 @@ 2 + false main.py - PythonEditor.RunConfiguration./home/jeremy.cotineau/perso/auto_builder/main.py - /home/jeremy.cotineau/perso/auto_builder/main.py - /home/jeremy.cotineau/perso/auto_builder/main.py - false + PythonEditor.RunConfiguration.C:/Users/jerem/Documents/wakfu_auto_builder/main.py + C:/Users/jerem/Documents/wakfu_auto_builder/main.py + true + {3860718f-3890-4386-b35e-6679a4838a0e} + C:\Users\jerem\Documents\wakfu_auto_builder\main.py true - false true - /home/jeremy.cotineau/perso/auto_builder + C:/Users/jerem/Documents/wakfu_auto_builder 1 diff --git a/auto_builder.pyproject.user.c84d5e3 b/auto_builder.pyproject.user.c84d5e3 new file mode 100644 index 0000000..37198ca --- /dev/null +++ b/auto_builder.pyproject.user.c84d5e3 @@ -0,0 +1,169 @@ + + + + + + EnvironmentId + {c84d5e35-5621-4e71-b77c-153aba92a261} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 8 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + Desktop + {4a966a6e-2dee-4f8f-be39-4ac6b53e4565} + 0 + 0 + 0 + + /home/jeremy.cotineau/perso/auto_builder + + + true + Python.PysideBuildStep + /home/jeremy.cotineau/.local/bin/pyside6-project + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + 0 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + build + Python.PySideBuildConfiguration + + 1 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + main.py + PythonEditor.RunConfiguration./home/jeremy.cotineau/perso/auto_builder/main.py + /home/jeremy.cotineau/perso/auto_builder/main.py + /home/jeremy.cotineau/perso/auto_builder/main.py + false + true + false + true + /home/jeremy.cotineau/perso/auto_builder + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/init.py b/init.py deleted file mode 100644 index 10158f0..0000000 --- a/init.py +++ /dev/null @@ -1,26 +0,0 @@ -import subprocess -import sys -import settings -import importlib -from wakutils import setupJson - - -def init(): - install_requirements() - settings.initGlobal() - setupJson() - - -def install_requirements(): - try: - file_path = "requirements.txt" - with open(file_path, 'r') as file: - requirements = [line.strip() for line in file] - for depedency in requirements: - try: - importlib.import_module(depedency) - except ImportError: - subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", file_path]) - except subprocess.CalledProcessError as e: - print("Erreur lors de l'installation des dépendances.") - sys.exit(1) diff --git a/main.py b/main.py index f0e8caa..15f12cc 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ -from init import init +import settings +from wakutils import setupJson import sys from PySide6.QtQml import QQmlApplicationEngine @@ -16,15 +17,16 @@ if __name__ == "__main__": - #Set up the application window - app = QGuiApplication(sys.argv) - engine = QQmlApplicationEngine() + #Set up the application window + app = QGuiApplication(sys.argv) + engine = QQmlApplicationEngine() - init() -# solve() + settings.initGlobal() + setupJson() + # solve() - engine.load("views/mainPage.qml") - sys.exit(app.exec()) + engine.load("views/mainPage.qml") + sys.exit(app.exec()) diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 4adfed0..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -ortools diff --git a/wakutils.py b/wakutils.py index c930b0a..474cf13 100644 --- a/wakutils.py +++ b/wakutils.py @@ -1,20 +1,23 @@ # This Python file uses the following encoding: utf-8 +import os import json import settings import tempfile def parse(): - itemPropertiesFile = open("data/1.78.1.7/itemProperties.json", encoding="utf-8") + current_dir = os.path.dirname(os.path.abspath(__file__)) + + itemPropertiesFile = open(os.path.join(current_dir,"data/1.78.1.7/itemProperties.json"), encoding="utf-8") itemPropertiesData = json.load(itemPropertiesFile) - itemsFile = open("data/1.78.1.7/items.json", encoding="utf-8") + itemsFile = open(os.path.join(current_dir,"data/1.78.1.7/items.json"), encoding="utf-8") itemsData = json.load(itemsFile) - equipmentItemTypesFile = open("data/1.78.1.7/equipmentItemTypes.json", encoding="utf-8") + equipmentItemTypesFile = open(os.path.join(current_dir,"data/1.78.1.7/equipmentItemTypes.json"), encoding="utf-8") equipmentItemTypesData = json.load(equipmentItemTypesFile) - actionFile = open("data/1.78.1.7/actions.json", encoding="utf-8") + actionFile = open(os.path.join(current_dir,"data/1.78.1.7/actions.json"), encoding="utf-8") actionData = json.load(actionFile) settings.ITEMS_DATA=itemsData