chore: clear typehinting errors

This commit is contained in:
aclist 2026-08-12 05:07:01 +09:00
parent a1c0592c7d
commit 65e11ddd03

View File

@ -9,6 +9,7 @@ import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk # noqa E402 from gi.repository import Gtk # noqa E402
class AbortDialog(Gtk.MessageDialog): class AbortDialog(Gtk.MessageDialog):
def __init__(self, string: str, buttons: Gtk.ButtonsType) -> None: def __init__(self, string: str, buttons: Gtk.ButtonsType) -> None:
super().__init__( super().__init__(
@ -23,7 +24,7 @@ class AbortDialog(Gtk.MessageDialog):
aa = self.get_action_area() aa = self.get_action_area()
aa.set_margin_bottom(20) aa.set_margin_bottom(20)
aa.set_layout(Gtk.ButtonBoxStyle.CENTER) aa.set_layout(Gtk.ButtonBoxStyle.CENTER) # type: ignore
self.outer = self.get_content_area() self.outer = self.get_content_area()
self.outer.set_margin_start(30) self.outer.set_margin_start(30)
@ -51,11 +52,12 @@ class AbortDialog(Gtk.MessageDialog):
print("response was cancel") print("response was cancel")
return return
class EarlyAlertDialog(AbortDialog): class EarlyAlertDialog(AbortDialog):
def __init__(self, string: str, buttons: Gtk.ButtonsType) -> None: def __init__(self, string: str) -> None:
super().__init__(string=string, buttons=Gtk.ButtonsType.OK) super().__init__(string=string, buttons=Gtk.ButtonsType.OK)
class EarlyIgnoreDialog(AbortDialog): class EarlyIgnoreDialog(AbortDialog):
def __init__(self, string: str) -> None: def __init__(self, string: str) -> None:
super().__init__(string=string, buttons=Gtk.ButtonsType.OK_CANCEL) super().__init__(string=string, buttons=Gtk.ButtonsType.OK_CANCEL)