chore: clear typehinting errors

This commit is contained in:
aclist committed 2026-05-05 23:37:31 +09:00
1 parent e64feac425
commit 25640751a5
23 files changed
+86 -105

No files matched your search

+2 -2
View File
@@ -117,13 +117,13 @@ class RefreshButton(IconTextButton):
self.show_time(True)
GLib.timeout_add_seconds(1, self.decrement)
def decrement(self) -> type[GLib.SOURCE_REMOVE] | Literal[True]:
def decrement(self) -> bool:
self.time -= 1
if self.time == 0:
self.time = 30
self.show_time(False)
self.set_sensitive(True)
return GLib.SOURCE_REMOVE
return False
self.show_time(True)
return True
+2 -2
View File
@@ -1,17 +1,17 @@
from dzgui.util import strings, css, open_links
from dzgui.util import css
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk # noqa
class HeadingFrame(Gtk.Box):
def __init__(self, widget: Gtk.Widget, heading: str) -> None:
super().__init__(orientation=Gtk.Orientation.VERTICAL)
label = Gtk.Label(label=heading)
label.set_halign(Gtk.Align.START)
# TODO: rename selector
css.add_class(label, "settings-subheading")
frame = Gtk.Frame(hexpand=True)
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING
from typing import Self, TYPE_CHECKING
from dzgui.const.enum import ModButton
from dzgui.const.constants import NO_EXPAND, FILL, NO_PADDING
@@ -64,7 +64,7 @@ class ModSelectionPanel(Gtk.Box):
self.connect("map", self._reinit_button)
def _reinit_button(self, s) -> None:
def _reinit_button(self, widget: Self) -> None:
for child in self.stale_panel.get_children():
if child.enum == ModButton.UNHIGHLIGHT_STALE:
child.set_sensitive(False)
+1 -1
View File
@@ -131,7 +131,7 @@ class Statusbar(Gtk.Grid):
def get_text(self) -> str:
area = self.statusbar.get_message_area()
label = area.get_children()[0]
return label.get_text()
return str(label.get_text())
def set_by_context(
self, context: Union[NotebookPage, "ServerTab"], string: str