mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
INCOMPLETE, DONT PUSH:
refactor: reorganize state management and update import paths across modules and start changing json parsing
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from core.interface.gui import MainWindow
|
||||
from core.interface.gui import state_debug
|
||||
from core.utils.state import state
|
||||
from core.utils.data.state import state
|
||||
from core.network.aria2_integration import aria2server
|
||||
from PySide6 import QtWidgets
|
||||
import qdarktheme
|
||||
@@ -9,10 +8,10 @@ import signal
|
||||
import atexit
|
||||
import sys
|
||||
|
||||
debug = True
|
||||
# Debug Output
|
||||
state.debug = True
|
||||
|
||||
def run_gui():
|
||||
state_debug(debug)
|
||||
app = QtWidgets.QApplication([])
|
||||
if darkdetect.isDark:
|
||||
app.setStyleSheet(qdarktheme.load_stylesheet("dark"))
|
||||
@@ -31,7 +30,7 @@ def run_aria2server():
|
||||
def kill_aria2server():
|
||||
if state.aria2process:
|
||||
state.aria2process.kill()
|
||||
if debug:
|
||||
if state.debug:
|
||||
print("\nKilled Aria2")
|
||||
|
||||
|
||||
@@ -41,12 +40,12 @@ def keyboardinterrupthandler(signum, frame):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if debug:
|
||||
if state.debug:
|
||||
print("Starting Aria2 Server")
|
||||
state.aria2process = run_aria2server()
|
||||
signal.signal(signal.SIGINT, keyboardinterrupthandler)
|
||||
atexit.register(kill_aria2server)
|
||||
if debug:
|
||||
if state.debug:
|
||||
print("Launching GUI")
|
||||
run_gui()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user