mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
feat: initialize network interface state and log interface details
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from core.utils.general.logs import consoleLog
|
||||
from core.utils.data.state import state
|
||||
import psutil
|
||||
|
||||
addrs = psutil.net_if_addrs()
|
||||
@@ -38,3 +39,6 @@ def list_interfaces() -> None:
|
||||
status = "INACTIVE"
|
||||
consoleLog(f"Found Interface: {interface} [{status}]")
|
||||
|
||||
def init_interfaces():
|
||||
state.interfaces = list(addrs.keys())
|
||||
state.active_interfaces = get_active_interfaces()
|
||||
@@ -27,6 +27,8 @@ class AppState(QObject):
|
||||
self.dl_session: Any = None
|
||||
self.active_downloads: List[str] = {}
|
||||
self.window_transparency: bool = False
|
||||
self.interfaces: List = []
|
||||
self.active_interfaces: List = []
|
||||
|
||||
@property
|
||||
def image_path(self) -> str:
|
||||
|
||||
@@ -6,7 +6,7 @@ from core.utils.general.logs import get_download_logs
|
||||
from core.utils.general.shutdown import closehelper, shutdown_event
|
||||
from core.utils.general.wrappers import run_thread
|
||||
from core.utils.general.loghandler import split_data, check_completed
|
||||
from core.network.interface import list_interfaces
|
||||
from core.network.interface import list_interfaces, init_interfaces
|
||||
from core.utils.config.config import read_config
|
||||
from PySide6 import QtWidgets
|
||||
from PySide6.QtCore import Qt
|
||||
@@ -54,6 +54,8 @@ if __name__ == "__main__":
|
||||
consoleLog("Started check_completed thread")
|
||||
consoleLog("Fetching Network Interfaces...")
|
||||
list_interfaces()
|
||||
consoleLog("Initialiting Interface variables...")
|
||||
init_interfaces()
|
||||
consoleLog("Launching GUI")
|
||||
run_gui()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user