chore: clear linting errors

This commit is contained in:
aclist committed 2026-02-13 01:07:49 +09:00
1 parent 24125a7492
commit 7b06973af3
10 files changed
+13 -21

No files matched your search

-1
View File
@@ -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/) 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 third party libraries
# TODO: mention 'pre-commit install' command
-2
View File
@@ -389,8 +389,6 @@ def ping(iteration: int, row: list) -> Ping:
def query_api(key: str, appid: int, param: str) -> Res: def query_api(key: str, appid: int, param: str) -> Res:
import time
LIMIT = 10000 LIMIT = 10000
payload: dict[str, Union[int, str]] = { payload: dict[str, Union[int, str]] = {
"filter": r"\appid" + rf"\{appid}" + param, "filter": r"\appid" + rf"\{appid}" + param,
+1 -1
View File
@@ -8,7 +8,7 @@ from warnings import deprecated
from concurrent.futures import wait from concurrent.futures import wait
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
from pathlib import Path 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.pefile as PeFile
import dzgui.api.servers as Servers import dzgui.api.servers as Servers
+5 -4
View File
@@ -26,16 +26,17 @@ def get_cpu_model() -> str:
def print_servers(servers: list[str]) -> str: def print_servers(servers: list[str]) -> str:
s = "" s = ""
for server in servers: for server in servers:
s+= server + "\n" s += server + "\n"
return s return s
def print_mods(mods: list[int]) -> str: def print_mods(mods: list[int]) -> str:
s = "" s = ""
for mod in mods: for mod in mods:
s+= str(mod) + "\n" s += str(mod) + "\n"
return s return s
def write_diagnostic(config: Path, outfile: Path) -> None: def write_diagnostic(config: Path, outfile: Path) -> None:
# TODO: test availability on other distros # TODO: test availability on other distros
date = datetime.now().isoformat() date = datetime.now().isoformat()
@@ -62,7 +63,7 @@ def write_diagnostic(config: Path, outfile: Path) -> None:
servers = lookup(config, Preferences.IP_LIST) servers = lookup(config, Preferences.IP_LIST)
servers_pretty = print_servers(servers) servers_pretty = print_servers(servers)
# FIXME: extraneous newlines in lists # FIXME: extraneous newlines in lists of mods
template = f"""\ template = f"""\
{APP_NAME} version {version} ({branch}) {APP_NAME} version {version} ({branch})
Date: {date} Date: {date}
@@ -82,5 +83,5 @@ def write_diagnostic(config: Path, outfile: Path) -> None:
{servers_pretty} {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) outfile.write_text(output)
+1 -1
View File
@@ -1,7 +1,7 @@
import re import re
from dzgui.util.localize import number 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 import gi
+3 -1
View File
@@ -1,6 +1,8 @@
from dataclasses import dataclass from dataclasses import dataclass
from dzgui.const.constants import SYSTEM_LOG from dzgui.const.constants import SYSTEM_LOG
# TODO: move to util.format.py
def build_missing(build: str) -> str: def build_missing(build: str) -> str:
msg = ( msg = (
@@ -605,7 +607,7 @@ atomic_buttons = AtomicButton(
keys_tooltip="Toggles the keybindings dialog", 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" missing_changelog = "Error: failed to read changelog"
esc_to_return = "Press ESC to return" esc_to_return = "Press ESC to return"
+2 -7
View File
@@ -1,4 +1,4 @@
from typing import Optional, TYPE_CHECKING from typing import TYPE_CHECKING
from dzgui.const.enum import ServerTab from dzgui.const.enum import ServerTab
from dzgui.views.components.buttonbox import ButtonBox from dzgui.views.components.buttonbox import ButtonBox
@@ -50,11 +50,10 @@ class RightPanel(Gtk.Box):
if context in (ServerTab.RECENT, ServerTab.SAVED): if context in (ServerTab.RECENT, ServerTab.SAVED):
self.refresh_button.set_sensitive(False) self.refresh_button.set_sensitive(False)
# TODO: reference # TODO: reference for ping pass
# def _on_ping_clicked(self, button: Gtk.Button) -> None: # def _on_ping_clicked(self, button: Gtk.Button) -> None:
# block_signals() # block_signals()
# def _update_pings(): # def _update_pings():
# # TODO
# rows = ModelManager.get_filtered() # rows = ModelManager.get_filtered()
# with ThreadPoolExecutor(100) as executor: # with ThreadPoolExecutor(100) as executor:
# futures = [ # futures = [
@@ -67,14 +66,10 @@ class RightPanel(Gtk.Box):
# path = Gtk.TreePath.new_from_indices([res.iteration]) # path = Gtk.TreePath.new_from_indices([res.iteration])
# temp_model[path][9] = res.ping # temp_model[path][9] = res.ping
# ModelManager.ping_cache[res.addr] = res.ping # ModelManager.ping_cache[res.addr] = res.ping
# # TODO: drop/rewrite
# treeview.set_model(temp_model) # treeview.set_model(temp_model)
# treeview.wait_dialog.destroy() # treeview.wait_dialog.destroy()
# treeview.grab_focus() # treeview.grab_focus()
# # TODO:
# unblock_signals() # unblock_signals()
# temp_model = self.AppNav.treeview.get_model() # temp_model = self.AppNav.treeview.get_model()
# treeview.set_model(None) # treeview.set_model(None)
# treeview.wait_dialog = GenericDialog("Pinging servers", Popup.WAIT) # treeview.wait_dialog = GenericDialog("Pinging servers", Popup.WAIT)
-1
View File
@@ -1,4 +1,3 @@
from datetime import datetime
from typing import Self, Union, TYPE_CHECKING from typing import Self, Union, TYPE_CHECKING
from dzgui.const.enum import NotebookPage, ServerTab from dzgui.const.enum import NotebookPage, ServerTab
-2
View File
@@ -116,8 +116,6 @@ class WaitDialog(GenericDialog):
content.pack_end(spinner, NO_EXPAND, NO_FILL, 0) content.pack_end(spinner, NO_EXPAND, NO_FILL, 0)
spinner.start() spinner.start()
# FIXME: center on parent window
# self.show_all()
def _on_dialog_delete( def _on_dialog_delete(
self, response_id: Gtk.ResponseType, event: Gdk.Event self, response_id: Gtk.ResponseType, event: Gdk.Event
+1 -1
View File
@@ -183,7 +183,7 @@ class ServerTreeView(ContextMixin, TreeView):
self.start_distcalc() self.start_distcalc()
def _on_unmap(self, a) -> None: 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) GLib.Source.remove(self.queue_id)
self.emitter.disconnect(self.handler_id) self.emitter.disconnect(self.handler_id)
if self.get_enum() is ServerTab.LAN: if self.get_enum() is ServerTab.LAN: