adding build file, updating gititgnore, adding check in backup to create archive if source is present

This commit is contained in:
2025-02-05 08:18:37 +01:00
parent 7140032109
commit 18be111dc1
3 changed files with 23 additions and 3 deletions

7
.gitignore vendored
View File

@@ -220,8 +220,11 @@ compile_commands.json
**/tempCodeRunnerFile.py
output/**
archive/**
.vscode
backup
database
report/**
# Rust
target/
uv.lock

17
build.py Normal file
View File

@@ -0,0 +1,17 @@
import os
import shutil
def build_release():
print(f"Building Application")
os.system(
f"uv run python -m nuitka --standalone --output-dir=build --include-package=PyQt6 --include-package=pygments --include-data-dir=./config=config --include-data-dir=./docs=docs --include-data-dir=./icons=icons --include-data-dir=./.venv/Lib/site-packages/PyQt6/=PyQt6 --windows-icon-from-ico=icons/icon.ico main.py"
)
shutil.copytree(
".venv/Lib/site-packages/PyQt6/", "build/main.dist/PyQt6/", dirs_exist_ok=True
)
shutil.move("build/main.dist", "build/LibrarySystem")
if __name__ == "__main__":
build_release()

View File

@@ -29,7 +29,7 @@ class Backup:
self.backup = True
def createBackup(self):
if os.path.exists(self.archivePath):
if os.path.exists(self.archivePath) and os.path.exists(self.source_path):
# copy the active database to the archive path, add _[date]
day = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
# copy the active database to the archive path, add _[date]