mirror of
https://github.com/aclist/dztui.git
synced 2026-10-29 22:22:52 +01:00
chore: clear typehinting errors
This commit is contained in:
1 parent
bc1118a29f
commit
46fba4eef1
6 files changed
+32
-26
No files matched your search
+21
-15
@@ -1,43 +1,49 @@
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
from typing import TYPE_CHECKING, Union
|
||||
|
||||
from dzgui.api.steam import launch_offline
|
||||
from dzgui.const.enum import Preferences
|
||||
from dzgui.managers.threading import call_on_thread, ThreadingManager
|
||||
from dzgui.strings import dialogs
|
||||
from dzgui.util.symlinks import clone_symlinks
|
||||
from dzgui.util.symlink import clone_symlinks
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.controllers.mc import Controller
|
||||
|
||||
|
||||
class OfflineManager:
|
||||
def __init__(
|
||||
self,
|
||||
controller: "Controller",
|
||||
appid: int,
|
||||
mission: Union[Path, None] = None,
|
||||
mission: str = "",
|
||||
local_mods: Union[list[str], None] = None,
|
||||
custom_mods: Union[list[str], None] = None,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.thread_man = ThreadingManager()
|
||||
self.controller = controller
|
||||
self.thread_man = ThreadingManager(controller)
|
||||
|
||||
self.appid = appid
|
||||
self.mission_folder = mission
|
||||
self.local_mods = local_mods
|
||||
self.custom_mods = custom_mods
|
||||
|
||||
@call_on_thread(dialogs.waiting_for_launch)
|
||||
def launch(self) -> None:
|
||||
client = self.controller.query_config(Preferences.CLIENT)
|
||||
name = self.controller.query_config(Preferences.NAME)
|
||||
steam_path = self.controller.query_config(Preferences.DEFAULT)
|
||||
@call_on_thread(dialogs.waiting_for_launch)
|
||||
def launch(self) -> None:
|
||||
client = self.controller.query_config(Preferences.CLIENT)
|
||||
name = self.controller.query_config(Preferences.NAME)
|
||||
steam_path = self.controller.query_config(Preferences.DEFAULT)
|
||||
|
||||
new_symlinks: list[str] = []
|
||||
new_symlinks: list[str] = []
|
||||
|
||||
combined_mods: list[str] = []
|
||||
combined_mods: list[str] = []
|
||||
if self.local_mods is not None:
|
||||
combined_mods.extend(self.local_mods)
|
||||
|
||||
if self.custom_mods is not None:
|
||||
clone_symlinks(Path(steam_path))
|
||||
combined_mods.extend(new_symlinks)
|
||||
|
||||
# TODO: cf. rebuild_symlinks
|
||||
|
||||
clone_symlinks(Path(steam_path))
|
||||
launch_offline(client, self.appid, name, combined_mods)
|
||||
launch_offline(client, self.appid, name, combined_mods, self.mission_folder)
|
||||
Reference in new issue
Block a user