mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
chore: clear typehinting errors
This commit is contained in:
1 parent
f7fe62e661
commit
897186faa0
9 files changed
+32
-18
No files matched your search
+1
-1
@@ -87,7 +87,7 @@ def get_remote_signatures(mods: list[str]) -> list[tuple[str, str, int, int]]:
|
|||||||
return hashes
|
return hashes
|
||||||
|
|
||||||
|
|
||||||
# TODO:: set config to name=user, use official server and no mods,
|
# TODO: set config to name=user, use official server and no mods,
|
||||||
# ensure that formatted string is identical to fixture with same hash
|
# ensure that formatted string is identical to fixture with same hash
|
||||||
def connect(addr: str, appid: int, name: str, mods: list[str]) -> None:
|
def connect(addr: str, appid: int, name: str, mods: list[str]) -> None:
|
||||||
concat = concat_mods(mods)
|
concat = concat_mods(mods)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import shutil
|
# import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def uninstall(path: Path) -> None:
|
def uninstall(path: Path) -> None:
|
||||||
pass
|
pass
|
||||||
# TODO: use xdg object?
|
# TODO: use xdg object?
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from importlib import resources
|
from importlib import resources
|
||||||
from packaging.version import Version, InvalidVersion
|
from packaging.version import Version
|
||||||
|
|
||||||
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, REQUEST_TIMEOUT
|
from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, REQUEST_TIMEOUT
|
||||||
from dzgui.const.endpoints import GITHUB_RELEASES, CODEBERG_RELEASES
|
from dzgui.const.endpoints import GITHUB_RELEASES, CODEBERG_RELEASES
|
||||||
|
|||||||
+4
-4
@@ -28,6 +28,8 @@ from dzgui.init.prereqs import has_steam_client
|
|||||||
from dzgui.init.proc import has_cmd
|
from dzgui.init.proc import has_cmd
|
||||||
from dzgui.init.update import allow_updates, check_updates
|
from dzgui.init.update import allow_updates, check_updates
|
||||||
|
|
||||||
|
from dzgui.strings import init
|
||||||
|
|
||||||
from dzgui.util.map_count import get_map_count
|
from dzgui.util.map_count import get_map_count
|
||||||
from dzgui.util.deck import is_steam_deck, is_game_mode
|
from dzgui.util.deck import is_steam_deck, is_game_mode
|
||||||
from dzgui.util.localize import set_locale
|
from dzgui.util.localize import set_locale
|
||||||
@@ -126,7 +128,7 @@ def main() -> None:
|
|||||||
|
|
||||||
if _is_steam_deck is False:
|
if _is_steam_deck is False:
|
||||||
# TODO: sudo escalation dialog
|
# TODO: sudo escalation dialog
|
||||||
count = get_map_count()
|
# count = get_map_count()
|
||||||
# TODO: move into module
|
# TODO: move into module
|
||||||
if has_steam_client() is False:
|
if has_steam_client() is False:
|
||||||
EarlyAlertDialog(init.requires_steam)
|
EarlyAlertDialog(init.requires_steam)
|
||||||
@@ -147,7 +149,6 @@ def main() -> None:
|
|||||||
tool = cmd
|
tool = cmd
|
||||||
break
|
break
|
||||||
|
|
||||||
# TODO: push is_game_mode to preconnect dialog
|
|
||||||
prefs = UserPrefs(
|
prefs = UserPrefs(
|
||||||
is_steam_deck=_is_steam_deck,
|
is_steam_deck=_is_steam_deck,
|
||||||
is_game_mode=_is_game_mode,
|
is_game_mode=_is_game_mode,
|
||||||
@@ -160,6 +161,5 @@ def main() -> None:
|
|||||||
foreground_cmd=tool,
|
foreground_cmd=tool,
|
||||||
)
|
)
|
||||||
# TODO: drop allow updates
|
# TODO: drop allow updates
|
||||||
# TODO: strings
|
print(init.all_ok)
|
||||||
print("All OK. Loading UI...")
|
|
||||||
App(prefs)
|
App(prefs)
|
||||||
@@ -30,10 +30,9 @@ from dzgui.const.constants import (
|
|||||||
APPID_DAYZ_EXP,
|
APPID_DAYZ_EXP,
|
||||||
APPNAME_DAYZ,
|
APPNAME_DAYZ,
|
||||||
APPNAME_DAYZ_EXP,
|
APPNAME_DAYZ_EXP,
|
||||||
DAYZ_BINARY,
|
|
||||||
)
|
)
|
||||||
from dzgui.const.enum import NotebookPage, Preferences
|
from dzgui.const.enum import NotebookPage, Preferences
|
||||||
from dzgui.init.proc import foreground, is_dayz_running, is_steam_running, is_running
|
from dzgui.init.proc import foreground, is_dayz_running, is_steam_running
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.strings.dialogs import waiting_for_launch, waiting_for_mods
|
from dzgui.strings.dialogs import waiting_for_launch, waiting_for_mods
|
||||||
from dzgui.strings.server_mods import checkmark, resync
|
from dzgui.strings.server_mods import checkmark, resync
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
from typing import Callable, Literal, Self, TYPE_CHECKING
|
from typing import Callable, Self, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.util.clip import copy_clipboard
|
from dzgui.util.clip import copy_clipboard
|
||||||
from dzgui.util.format import pluralize
|
from dzgui.util.format import pluralize
|
||||||
from dzgui.util.strings import alert_button_tooltip, atomic_buttons, connect_panel
|
from dzgui.util.strings import (
|
||||||
|
alert_button_tooltip,
|
||||||
|
atomic_buttons,
|
||||||
|
connect_panel,
|
||||||
|
)
|
||||||
from dzgui.const.constants import (
|
from dzgui.const.constants import (
|
||||||
CLIPBOARD,
|
CLIPBOARD,
|
||||||
INPUT_KEYBOARD,
|
INPUT_KEYBOARD,
|
||||||
@@ -163,6 +167,12 @@ class SteamTextButton(SteamConnectButton):
|
|||||||
self.set_label(label)
|
self.set_label(label)
|
||||||
|
|
||||||
|
|
||||||
|
class SteamWorkshopButton(SteamTextButton):
|
||||||
|
def __init__(self) -> None:
|
||||||
|
super().__init__(label="Steam Workshop")
|
||||||
|
self.set_tooltip_text("connect to workshop")
|
||||||
|
|
||||||
|
|
||||||
class AddButton(IconTextButton):
|
class AddButton(IconTextButton):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(icon=LIST_ADD, label=connect_panel.add)
|
super().__init__(icon=LIST_ADD, label=connect_panel.add)
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ class WorkshopLinkDialog(GenericDialog):
|
|||||||
def _on_button_clicked(self, button: Gtk.Button, uid: str) -> None:
|
def _on_button_clicked(self, button: Gtk.Button, uid: str) -> None:
|
||||||
# TODO: currently checks user id on instantiation
|
# TODO: currently checks user id on instantiation
|
||||||
self.controller.open_user_workshop(uid)
|
self.controller.open_user_workshop(uid)
|
||||||
# client = self.controller.query_config(Preferences.CLIENT)
|
|
||||||
# open_user_workshop(uid, client)
|
|
||||||
|
|
||||||
def _on_dialog_response(self, dialog: Self, resp: Gtk.ResponseType) -> None:
|
def _on_dialog_response(self, dialog: Self, resp: Gtk.ResponseType) -> None:
|
||||||
match resp:
|
match resp:
|
||||||
|
|||||||
@@ -145,11 +145,18 @@ class Options(Gtk.Box):
|
|||||||
self.force_button.set_sensitive(False)
|
self.force_button.set_sensitive(False)
|
||||||
|
|
||||||
eb = InfoEventBox(strings.options.dl_eventbox, controller)
|
eb = InfoEventBox(strings.options.dl_eventbox, controller)
|
||||||
eb2 = InfoEventBox(strings.options.force_eventbox, controller)
|
# eb2 = InfoEventBox(strings.options.force_eventbox, controller)
|
||||||
|
|
||||||
|
from dzgui.views.components.buttons import SteamWorkshopButton
|
||||||
|
|
||||||
|
workshop_button = SteamWorkshopButton() # label=strings.self_workshop)
|
||||||
|
workshop_button.connect(
|
||||||
|
"clicked", lambda _: self.controller.open_user_workshop(self.uid)
|
||||||
|
)
|
||||||
mod_rows = [
|
mod_rows = [
|
||||||
[LeftLabel(strings.options.install_mode), self.mod_install_toggle, eb],
|
[LeftLabel("Steam Workshop"), workshop_button, eb],
|
||||||
[LeftLabel(strings.options.force_update), self.force_button, eb2],
|
# [LeftLabel(strings.options.install_mode), self.mod_install_toggle, eb],
|
||||||
|
# [LeftLabel(strings.options.force_update), self.force_button, eb2],
|
||||||
]
|
]
|
||||||
|
|
||||||
self.dayz_version_label = Gtk.Label(label=strings.null)
|
self.dayz_version_label = Gtk.Label(label=strings.null)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ def keys():
|
|||||||
"fav_server",
|
"fav_server",
|
||||||
"fav_label",
|
"fav_label",
|
||||||
"name",
|
"name",
|
||||||
"branch",
|
|
||||||
"fullscreen",
|
"fullscreen",
|
||||||
"steam_api",
|
"steam_api",
|
||||||
"auto_install",
|
"auto_install",
|
||||||
@@ -29,7 +28,7 @@ def keys():
|
|||||||
"client",
|
"client",
|
||||||
"ip_list",
|
"ip_list",
|
||||||
"use_miles",
|
"use_miles",
|
||||||
"start_tab"
|
"start_tab",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user