From 7b06973af36a09e33a7fb4e960c18a1210c58a61 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Fri, 13 Feb 2026 01:07:49 +0900 Subject: [PATCH] chore: clear linting errors --- README.md | 1 - dzgui/api/servers.py | 2 -- dzgui/controllers/mc.py | 2 +- dzgui/util/diag.py | 9 +++++---- dzgui/util/format.py | 2 +- dzgui/util/strings.py | 4 +++- dzgui/views/components/right_panel.py | 9 ++------- dzgui/views/components/statusbar.py | 1 - dzgui/views/dialogs/generic.py | 2 -- dzgui/views/trees/tree_servers.py | 2 +- 10 files changed, 13 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 111e46b..969add7 100644 --- a/README.md +++ b/README.md @@ -25,4 +25,3 @@ Refer to the documentation for installation and setup instructions: Geolocation records from [DB-IP](https://db-ip.com) under [CC 4.0 license](https://creativecommons.org/licenses/by/4.0/) # TODO: mention third party libraries -# TODO: mention 'pre-commit install' command diff --git a/dzgui/api/servers.py b/dzgui/api/servers.py index a643bea..f2a3aaf 100644 --- a/dzgui/api/servers.py +++ b/dzgui/api/servers.py @@ -389,8 +389,6 @@ def ping(iteration: int, row: list) -> Ping: def query_api(key: str, appid: int, param: str) -> Res: - import time - LIMIT = 10000 payload: dict[str, Union[int, str]] = { "filter": r"\appid" + rf"\{appid}" + param, diff --git a/dzgui/controllers/mc.py b/dzgui/controllers/mc.py index c2cdcb5..5c18f0b 100644 --- a/dzgui/controllers/mc.py +++ b/dzgui/controllers/mc.py @@ -8,7 +8,7 @@ from warnings import deprecated from concurrent.futures import wait from concurrent.futures import ThreadPoolExecutor from pathlib import Path -from typing import Any, Callable, Literal, Union, TYPE_CHECKING +from typing import Any, Callable, TYPE_CHECKING import dzgui.api.pefile as PeFile import dzgui.api.servers as Servers diff --git a/dzgui/util/diag.py b/dzgui/util/diag.py index 8d069c2..d027687 100644 --- a/dzgui/util/diag.py +++ b/dzgui/util/diag.py @@ -26,16 +26,17 @@ def get_cpu_model() -> str: def print_servers(servers: list[str]) -> str: s = "" for server in servers: - s+= server + "\n" + s += server + "\n" return s def print_mods(mods: list[int]) -> str: s = "" for mod in mods: - s+= str(mod) + "\n" + s += str(mod) + "\n" return s + def write_diagnostic(config: Path, outfile: Path) -> None: # TODO: test availability on other distros date = datetime.now().isoformat() @@ -62,7 +63,7 @@ def write_diagnostic(config: Path, outfile: Path) -> None: servers = lookup(config, Preferences.IP_LIST) servers_pretty = print_servers(servers) - # FIXME: extraneous newlines in lists + # FIXME: extraneous newlines in lists of mods template = f"""\ {APP_NAME} version {version} ({branch}) Date: {date} @@ -82,5 +83,5 @@ def write_diagnostic(config: Path, outfile: Path) -> None: {servers_pretty} """ - output = "\n".join([line.lstrip() for line in template.split('\n')]) + output = "\n".join([line.lstrip() for line in template.split("\n")]) outfile.write_text(output) diff --git a/dzgui/util/format.py b/dzgui/util/format.py index 81db99c..9b06e30 100644 --- a/dzgui/util/format.py +++ b/dzgui/util/format.py @@ -1,7 +1,7 @@ import re from dzgui.util.localize import number -from dzgui.util.strings import no_mods, no_servers, distance_suffix +from dzgui.util.strings import no_mods, no_servers import gi diff --git a/dzgui/util/strings.py b/dzgui/util/strings.py index f53a695..4e4ecb2 100644 --- a/dzgui/util/strings.py +++ b/dzgui/util/strings.py @@ -1,6 +1,8 @@ from dataclasses import dataclass from dzgui.const.constants import SYSTEM_LOG +# TODO: move to util.format.py + def build_missing(build: str) -> str: msg = ( @@ -605,7 +607,7 @@ atomic_buttons = AtomicButton( keys_tooltip="Toggles the keybindings dialog", ) -steam_icon_missing="Steam icon not found in IconTheme" +steam_icon_missing = "Steam icon not found in IconTheme" missing_changelog = "Error: failed to read changelog" esc_to_return = "Press ESC to return" diff --git a/dzgui/views/components/right_panel.py b/dzgui/views/components/right_panel.py index 4a3e9ea..e1c95b5 100644 --- a/dzgui/views/components/right_panel.py +++ b/dzgui/views/components/right_panel.py @@ -1,4 +1,4 @@ -from typing import Optional, TYPE_CHECKING +from typing import TYPE_CHECKING from dzgui.const.enum import ServerTab from dzgui.views.components.buttonbox import ButtonBox @@ -50,11 +50,10 @@ class RightPanel(Gtk.Box): if context in (ServerTab.RECENT, ServerTab.SAVED): self.refresh_button.set_sensitive(False) - # TODO: reference + # TODO: reference for ping pass # def _on_ping_clicked(self, button: Gtk.Button) -> None: # block_signals() # def _update_pings(): - # # TODO # rows = ModelManager.get_filtered() # with ThreadPoolExecutor(100) as executor: # futures = [ @@ -67,14 +66,10 @@ class RightPanel(Gtk.Box): # path = Gtk.TreePath.new_from_indices([res.iteration]) # temp_model[path][9] = res.ping # ModelManager.ping_cache[res.addr] = res.ping - # # TODO: drop/rewrite # treeview.set_model(temp_model) # treeview.wait_dialog.destroy() # treeview.grab_focus() - - # # TODO: # unblock_signals() - # temp_model = self.AppNav.treeview.get_model() # treeview.set_model(None) # treeview.wait_dialog = GenericDialog("Pinging servers", Popup.WAIT) diff --git a/dzgui/views/components/statusbar.py b/dzgui/views/components/statusbar.py index 27a1d4d..f442422 100644 --- a/dzgui/views/components/statusbar.py +++ b/dzgui/views/components/statusbar.py @@ -1,4 +1,3 @@ -from datetime import datetime from typing import Self, Union, TYPE_CHECKING from dzgui.const.enum import NotebookPage, ServerTab diff --git a/dzgui/views/dialogs/generic.py b/dzgui/views/dialogs/generic.py index 6e704fc..742a817 100644 --- a/dzgui/views/dialogs/generic.py +++ b/dzgui/views/dialogs/generic.py @@ -116,8 +116,6 @@ class WaitDialog(GenericDialog): content.pack_end(spinner, NO_EXPAND, NO_FILL, 0) spinner.start() - # FIXME: center on parent window - # self.show_all() def _on_dialog_delete( self, response_id: Gtk.ResponseType, event: Gdk.Event diff --git a/dzgui/views/trees/tree_servers.py b/dzgui/views/trees/tree_servers.py index 52f0055..85a6a23 100644 --- a/dzgui/views/trees/tree_servers.py +++ b/dzgui/views/trees/tree_servers.py @@ -183,7 +183,7 @@ class ServerTreeView(ContextMixin, TreeView): self.start_distcalc() def _on_unmap(self, a) -> None: - # NOTE: remove queue checker for this tab + # NOTE: removes queue checker for this tab GLib.Source.remove(self.queue_id) self.emitter.disconnect(self.handler_id) if self.get_enum() is ServerTab.LAN: