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