mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
Fix invalid version detection, refactor main.py and add comments for improved code understanding
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
from core.utils.network.update_checker import get_updates
|
||||
from core.utils.network.updater import download_update
|
||||
from PySide6.QtWidgets import QDialog, QMessageBox
|
||||
from core.utils.logging.logs import consoleLog
|
||||
from core.utils.data.state import state
|
||||
from pathlib import Path
|
||||
import platform
|
||||
import json
|
||||
import os
|
||||
|
||||
def check_version():
|
||||
build_info_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "build_info.json")
|
||||
# Get build info filepath
|
||||
build_info_path = Path(__file__).resolve().parents[3] / "build_info.json" # parents[3] = climb up 4 directories from the file ran
|
||||
if os.path.exists(build_info_path):
|
||||
with open(build_info_path, "r") as f:
|
||||
build_info = json.load(f)
|
||||
state.version = build_info.get("version")
|
||||
|
||||
else:
|
||||
consoleLog(f"Could not find build info file (Path: {build_info_path})")
|
||||
|
||||
class UpdateDialog(QDialog):
|
||||
def __init__(self, parent=None):
|
||||
|
||||
Reference in New Issue
Block a user