From 0fedf5c82552c4d7a335d3c2b575ce2b51a92e7e Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Fri, 17 Jul 2020 03:08:09 +0200 Subject: [PATCH] Fix type annotation for old stats dialog class --- qt/aqt/gui_hooks.py | 10 +++++----- qt/tools/genhooks_gui.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qt/aqt/gui_hooks.py b/qt/aqt/gui_hooks.py index eea6fe9f5..2f30d22e4 100644 --- a/qt/aqt/gui_hooks.py +++ b/qt/aqt/gui_hooks.py @@ -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) diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index 331a0845f..f5db67f6f 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -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