mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
fix: clear typehinting errors
This commit is contained in:
1 parent
e1cb682e74
commit
f7a42e2cdb
5 files changed
+11
-13
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
from typing import TYPE_CHECKING, Union
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from typing import Callable, TYPE_CHECKING, Union
|
|||||||
import dzgui.api.pefile as PeFile
|
import dzgui.api.pefile as PeFile
|
||||||
from dzgui.api.mods import is_mission, get_custom_mods
|
from dzgui.api.mods import is_mission, get_custom_mods
|
||||||
from dzgui.api.steam import launch_offline
|
from dzgui.api.steam import launch_offline
|
||||||
from dzgui.const.constants import APP_NAME
|
from dzgui.const.constants import APP_NAME, APPID_DAYZ_EXP
|
||||||
from dzgui.const.enum import Preferences
|
from dzgui.const.enum import Preferences
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.model.model_factory import ModelFactory
|
from dzgui.model.model_factory import ModelFactory
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ def rebuild_symlinks(config: Path) -> None:
|
|||||||
clone_symlinks(steam_path)
|
clone_symlinks(steam_path)
|
||||||
|
|
||||||
|
|
||||||
def create_custom_symlinks(steam_path: Path, custom_dir: Path, uids: list[str]) -> None:
|
def create_custom_symlinks(
|
||||||
|
steam_path: Path, custom_dir: Path, uids: list[str]
|
||||||
|
) -> list[str]:
|
||||||
dayz_path = PeFile.get_nested_app_path(steam_path, APPID_DAYZ)
|
dayz_path = PeFile.get_nested_app_path(steam_path, APPID_DAYZ)
|
||||||
links = []
|
links = []
|
||||||
for uid in uids:
|
for uid in uids:
|
||||||
@@ -47,7 +49,6 @@ def create_custom_symlinks(steam_path: Path, custom_dir: Path, uids: list[str])
|
|||||||
return links
|
return links
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def clone_symlinks(steam_path: Path) -> None:
|
def clone_symlinks(steam_path: Path) -> None:
|
||||||
"""
|
"""
|
||||||
Shares symlinks between builds. Used after any symlink operation
|
Shares symlinks between builds. Used after any symlink operation
|
||||||
|
|||||||
@@ -56,9 +56,12 @@ class FolderPicker(Gtk.FileChooserDialog):
|
|||||||
folder = self.get_current_folder()
|
folder = self.get_current_folder()
|
||||||
if folder is None:
|
if folder is None:
|
||||||
try:
|
try:
|
||||||
folder = Path.from_uri(self.get_uri())
|
uri = self.get_uri()
|
||||||
|
if uri is None:
|
||||||
|
return None
|
||||||
|
return Path.from_uri(uri)
|
||||||
except Exception:
|
except Exception:
|
||||||
# FIXME
|
# FIXME: edge cases
|
||||||
return Path("/")
|
return Path("/")
|
||||||
self.destroy()
|
self.destroy()
|
||||||
return Path(folder)
|
return Path(folder)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from dzgui.const.constants import (
|
|||||||
ERROR,
|
ERROR,
|
||||||
FOLDER,
|
FOLDER,
|
||||||
)
|
)
|
||||||
from dzgui.const.enum import NotebookPage, Preferences
|
from dzgui.const.enum import NotebookPage
|
||||||
from dzgui.managers.offline import OfflineManager
|
from dzgui.managers.offline import OfflineManager
|
||||||
from dzgui.strings import generic, offline
|
from dzgui.strings import generic, offline
|
||||||
from dzgui.views.components.buttons import Icon, IconTextButton
|
from dzgui.views.components.buttons import Icon, IconTextButton
|
||||||
@@ -130,9 +130,6 @@ class FolderHBox(HBox):
|
|||||||
self.spinner.hide()
|
self.spinner.hide()
|
||||||
self.spinner.stop()
|
self.spinner.stop()
|
||||||
|
|
||||||
def get_spinner(self) -> None:
|
|
||||||
return self.spinner
|
|
||||||
|
|
||||||
def _on_unmap(self, widget: Self) -> None:
|
def _on_unmap(self, widget: Self) -> None:
|
||||||
self.unset_button.hide()
|
self.unset_button.hide()
|
||||||
self.label.set_label("")
|
self.label.set_label("")
|
||||||
@@ -216,7 +213,6 @@ class ModFrame(HeadingFrame):
|
|||||||
model, treeiters = self.tree.get_selection().get_selected_rows()
|
model, treeiters = self.tree.get_selection().get_selected_rows()
|
||||||
if model is None:
|
if model is None:
|
||||||
return []
|
return []
|
||||||
# TODO: include mod paths for custom mods
|
|
||||||
if type(self) is CustomModFrame:
|
if type(self) is CustomModFrame:
|
||||||
return [model[_iter][2] for _iter in treeiters]
|
return [model[_iter][2] for _iter in treeiters]
|
||||||
else:
|
else:
|
||||||
@@ -459,11 +455,9 @@ class OfflineLoader(Gtk.Box):
|
|||||||
self.back.emit("clicked")
|
self.back.emit("clicked")
|
||||||
|
|
||||||
def populate(self, store: Union["FastInsertListStore", None]) -> None:
|
def populate(self, store: Union["FastInsertListStore", None]) -> None:
|
||||||
# NOTE: suppress custom tree until explicitly loaded
|
|
||||||
if store is None:
|
if store is None:
|
||||||
return
|
return
|
||||||
self.local_frame.start(store)
|
self.local_frame.start(store)
|
||||||
# self.custom_frame.start(store)
|
|
||||||
|
|
||||||
def _on_back_clicked(self, button: Gtk.Button) -> None:
|
def _on_back_clicked(self, button: Gtk.Button) -> None:
|
||||||
self.controller.open_page(NotebookPage.MODS)
|
self.controller.open_page(NotebookPage.MODS)
|
||||||
|
|||||||
Reference in new issue
Block a user