diff --git a/.gitignore b/.gitignore index fa8aa8a..14d7b03 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ results/ venv/ idea/ surveys.json + +build/ \ No newline at end of file diff --git a/README.md b/README.md index 09eebcc..cf3b52d 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,5 @@ Or download one of the build in the [releases page](https://github.com/Faraphel/ You can run the projet simply by using the command `python3 main.py`. A window will then open containing the survey. Once the survey finished, a file containing all the data -will be created in the `./result/` directory. \ No newline at end of file +will be created in the `./results/` directory. +If configured properly, the result can also be automatically sent to a discord webhooks. diff --git a/assets/icon.ico b/assets/icon.ico new file mode 100644 index 0000000..5289d9b Binary files /dev/null and b/assets/icon.ico differ diff --git a/requirements.txt b/requirements.txt index 941f4ca..af5a0aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,6 @@ PyQt6~=6.6.1 PyQt6-WebEngine nextcord~=2.6.0 -requests~=2.31.0 \ No newline at end of file +requests~=2.31.0 + +cx_freeze \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..5dbe8ca --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +import sys + +from cx_Freeze import setup, Executable + +from source import __appname__, __str_version__, __author__, __mail__, __description__, __icon_ico__ + + +# Win32GUI should be used only for Windows GUI app +base = "Win32GUI" if sys.platform == "win32" else None + + +setup( + name=__appname__, + version=__str_version__, + description=__description__, + author=__author__, + author_email=__mail__, + url='', + license='', + + options={ + "build_exe": { + "include_msvcr": True, + "include_files": [ + ("./assets/", "./assets/"), + ("./README.md", "./README.md"), + ] + } + }, + + executables=[Executable( + "main.py", + base=base, + target_name=__appname__, + icon=__icon_ico__ + )] +) \ No newline at end of file diff --git a/source/__init__.py b/source/__init__.py index a42ad09..76d3c77 100644 --- a/source/__init__.py +++ b/source/__init__.py @@ -1,3 +1,12 @@ from pathlib import Path assets_path = Path("./assets/") + +__appname__ = "Survey Engine" +__version__ = (1,0,0) +__str_version__ = ".".join(map(str, __version__)) +__author__ = "Faraphel" +__mail__ = "rc60650@hotmail.com" +__description__ = "An engine to create survey." +__icon_png__ = str(assets_path / "icon.png") +__icon_ico__ = str(assets_path / "icon.ico") diff --git a/source/widget/SurveyWindow.py b/source/widget/SurveyWindow.py index 9f06da1..67e942d 100644 --- a/source/widget/SurveyWindow.py +++ b/source/widget/SurveyWindow.py @@ -3,8 +3,7 @@ from pathlib import Path from PyQt6.QtGui import QIcon from PyQt6.QtWidgets import QMainWindow -from source import widget, assets_path - +from source import widget, assets_path, __icon_png__ icon_path = assets_path / "icon.png" @@ -13,7 +12,7 @@ class SurveyWindow(QMainWindow): def __init__(self, survey_path: Path | str): super().__init__() - self.setWindowIcon(QIcon(str(icon_path.resolve()))) + self.setWindowIcon(QIcon(__icon_png__)) self.setWindowTitle(self.tr("SURVEY")) self.setCentralWidget(widget.SurveyEngine.from_file(survey_path))