Fix type annotation for old stats dialog class
This commit is contained in:
parent
b89811bfba
commit
0fedf5c825
@ -2345,20 +2345,20 @@ state_will_change = _StateWillChangeHook()
|
||||
class _StatsDialogOldWillShowHook:
|
||||
"""Allows changing the old stats dialog before it is shown."""
|
||||
|
||||
_hooks: List[Callable[["aqt.stats.NewDeckStats"], None]] = []
|
||||
_hooks: List[Callable[["aqt.stats.DeckStats"], None]] = []
|
||||
|
||||
def append(self, cb: Callable[["aqt.stats.NewDeckStats"], None]) -> None:
|
||||
"""(dialog: aqt.stats.NewDeckStats)"""
|
||||
def append(self, cb: Callable[["aqt.stats.DeckStats"], None]) -> None:
|
||||
"""(dialog: aqt.stats.DeckStats)"""
|
||||
self._hooks.append(cb)
|
||||
|
||||
def remove(self, cb: Callable[["aqt.stats.NewDeckStats"], None]) -> None:
|
||||
def remove(self, cb: Callable[["aqt.stats.DeckStats"], None]) -> None:
|
||||
if cb in self._hooks:
|
||||
self._hooks.remove(cb)
|
||||
|
||||
def count(self) -> int:
|
||||
return len(self._hooks)
|
||||
|
||||
def __call__(self, dialog: aqt.stats.NewDeckStats) -> None:
|
||||
def __call__(self, dialog: aqt.stats.DeckStats) -> None:
|
||||
for hook in self._hooks:
|
||||
try:
|
||||
hook(dialog)
|
||||
|
@ -610,7 +610,7 @@ hooks = [
|
||||
),
|
||||
Hook(
|
||||
name="stats_dialog_old_will_show",
|
||||
args=["dialog: aqt.stats.NewDeckStats"],
|
||||
args=["dialog: aqt.stats.DeckStats"],
|
||||
doc="""Allows changing the old stats dialog before it is shown.""",
|
||||
),
|
||||
# Other
|
||||
|
Loading…
Reference in New Issue
Block a user