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:
|
class _StatsDialogOldWillShowHook:
|
||||||
"""Allows changing the old stats dialog before it is shown."""
|
"""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:
|
def append(self, cb: Callable[["aqt.stats.DeckStats"], None]) -> None:
|
||||||
"""(dialog: aqt.stats.NewDeckStats)"""
|
"""(dialog: aqt.stats.DeckStats)"""
|
||||||
self._hooks.append(cb)
|
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:
|
if cb in self._hooks:
|
||||||
self._hooks.remove(cb)
|
self._hooks.remove(cb)
|
||||||
|
|
||||||
def count(self) -> int:
|
def count(self) -> int:
|
||||||
return len(self._hooks)
|
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:
|
for hook in self._hooks:
|
||||||
try:
|
try:
|
||||||
hook(dialog)
|
hook(dialog)
|
||||||
|
@ -610,7 +610,7 @@ hooks = [
|
|||||||
),
|
),
|
||||||
Hook(
|
Hook(
|
||||||
name="stats_dialog_old_will_show",
|
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.""",
|
doc="""Allows changing the old stats dialog before it is shown.""",
|
||||||
),
|
),
|
||||||
# Other
|
# Other
|
||||||
|
Loading…
Reference in New Issue
Block a user