chore: clear typehinting errors

This commit is contained in:
aclist committed 2026-11-10 05:58:02 +09:00
1 parent 9f36569fd4
commit bfe9b9d147
8 files changed
+12 -11

No files matched your search

+3 -3
View File
@@ -274,7 +274,7 @@ class Controller(GObject.GObject):
except Exception as e:
dialog = ExceptionDialog(self, str(e))
dialog.show_all()
dialog.run()
dialog.run() # type: ignore[no-untyped-call]
def select_colorized(self) -> None:
mod_man = self.mediator.modtreeview.get_mod_man()
@@ -308,7 +308,7 @@ class Controller(GObject.GObject):
except Exception as e:
dialog = ExceptionDialog(self, str(e))
dialog.show_all()
dialog.run()
dialog.run() # type: ignore[no-untyped-call]
def update_steam_api_key(self, text: str) -> None:
self.config_man.update_steam_api_key(text)
@@ -365,7 +365,7 @@ class Controller(GObject.GObject):
filter_man = self.get_filter_man()
return filter_man.get_map_store()
def get_enabled_filters(self) -> dict:
def get_enabled_filters(self) -> dict[str, bool]:
filter_man = self.get_filter_man()
return filter_man.get_filters()
+1 -1
View File
@@ -44,7 +44,7 @@ class ContextMenuManager:
# UNTHREADED
case ContextMenu.ADD_NOTE:
dialog = NoteDialog(self.controller)
dialog.run()
dialog.run() # type: ignore[no-untyped-call]
case ContextMenu.COPY_SERVER_IP:
self.copy_server_ip()
case ContextMenu.COPY_SERVER_NAME:
+1 -1
View File
@@ -11,7 +11,7 @@ from gi.repository.Gtk import ListStore, TreeIter # noqa E402
from gi.repository import GObject # noqa E402
GTYPE_TO_PYTHON = {
GObject.type_from_name(GObject.type_name(ptype)): ptype
GObject.type_from_name(GObject.type_name(ptype)): ptype # type: ignore[no-untyped-call]
for ptype in (int, float, str, bool, object)
}
+2 -2
View File
@@ -59,7 +59,7 @@ class CalcDist:
self,
addr: str,
enum: "ServerTab",
result_queue: "Queue",
result_queue: "Queue[tuple[str, Haversine | None, ServerTab]]",
controller: "Controller",
cache: dict[str, Haversine],
) -> None:
@@ -72,7 +72,7 @@ class CalcDist:
self.ip = self.addr
dist = self.compare(self.ip)
self.result_queue.put([self.addr, dist, self.enum])
self.result_queue.put((self.addr, dist, self.enum))
def compare(self, remote_ip: str) -> Haversine | None:
prefs = self.controller.get_prefs()
+1 -1
View File
@@ -31,7 +31,7 @@ class ReservedIPError(Exception):
pass
def ip2list(ip: str) -> list:
def ip2list(ip: str) -> list[int]:
return [int(digit) for digit in ip.split(".")]
+1 -1
View File
@@ -64,7 +64,7 @@ class IconButton(Gtk.Button):
self.icon = Icon(icon, margin_start=margin_start, margin_end=margin_end)
self.set_image(self.icon)
self.set_image_position(position)
self.set_focus_on_click(False)
self.set_focus_on_click(False) # type: ignore[no-untyped-call]
self.set_always_show_image(True)
def swap_icon(self, icon: str) -> None:
+1 -1
View File
@@ -10,7 +10,7 @@ from dzgui.views.components.labels import BoldLabel
from dzgui.views.components.box import VBox, HBox
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib, GObject # type: ignore # noqa E402
from gi.repository import Gtk, GLib, GObject # noqa E402
DAY_START_TIME = time(hour=6, minute=0, second=0)
DAY_END_TIME = time(hour=18, minute=0, second=0)
+2 -1
View File
@@ -32,6 +32,7 @@ if TYPE_CHECKING:
from dzgui.controllers.mc import Controller
from dzgui.controllers.emitter import Emitter
from dzgui.model.model_factory import FastInsertListStore
from dzgui.util.dist import Haversine
QUEUE_CHECK_DELAY = 200
@@ -64,7 +65,7 @@ class ServerTreeView(ContextMixin, TreeView): # type: ignore
self.queue_id: int
self.handler_id: int
self.queue: Queue = Queue()
self.queue: Queue[tuple[str, "Haversine" | None, ServerTab]] = Queue()
self.seen_cache: list[Record] = []