mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
Turn on check_untyped_defs for aqt.progress
This commit is contained in:
parent
83449e35ad
commit
f529124bbf
2 changed files with 6 additions and 4 deletions
|
@ -73,7 +73,7 @@ class ProgressManager:
|
||||||
self._win.setWindowModality(Qt.ApplicationModal)
|
self._win.setWindowModality(Qt.ApplicationModal)
|
||||||
self._win.setMinimumWidth(300)
|
self._win.setMinimumWidth(300)
|
||||||
self._setBusy()
|
self._setBusy()
|
||||||
self._shown = 0
|
self._shown: float = 0
|
||||||
self._counter = min
|
self._counter = min
|
||||||
self._min = min
|
self._min = min
|
||||||
self._max = max
|
self._max = max
|
||||||
|
@ -116,7 +116,7 @@ class ProgressManager:
|
||||||
|
|
||||||
if process and elapsed >= 0.2:
|
if process and elapsed >= 0.2:
|
||||||
self._updating = True
|
self._updating = True
|
||||||
self.app.processEvents()
|
self.app.processEvents() # type: ignore #possibly related to https://github.com/python/mypy/issues/6910
|
||||||
self._updating = False
|
self._updating = False
|
||||||
self._lastUpdate = time.time()
|
self._lastUpdate = time.time()
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ class ProgressManager:
|
||||||
if delta > 0.5:
|
if delta > 0.5:
|
||||||
self._showWin()
|
self._showWin()
|
||||||
|
|
||||||
def _showWin(self):
|
def _showWin(self) -> None:
|
||||||
self._shown = time.time()
|
self._shown = time.time()
|
||||||
self._win.show()
|
self._win.show()
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ class ProgressManager:
|
||||||
elap = time.time() - self._shown
|
elap = time.time() - self._shown
|
||||||
if elap >= 0.5:
|
if elap >= 0.5:
|
||||||
break
|
break
|
||||||
self.app.processEvents(QEventLoop.ExcludeUserInputEvents)
|
self.app.processEvents(QEventLoop.ExcludeUserInputEvents) # type: ignore #possibly related to https://github.com/python/mypy/issues/6910
|
||||||
self._win.cancel()
|
self._win.cancel()
|
||||||
self._win = None
|
self._win = None
|
||||||
self._shown = 0
|
self._shown = 0
|
||||||
|
|
|
@ -98,3 +98,5 @@ check_untyped_defs=true
|
||||||
check_untyped_defs=true
|
check_untyped_defs=true
|
||||||
[mypy-aqt.main]
|
[mypy-aqt.main]
|
||||||
check_untyped_defs=true
|
check_untyped_defs=true
|
||||||
|
[mypy-aqt.progress]
|
||||||
|
check_untyped_defs=true
|
||||||
|
|
Loading…
Reference in a new issue