mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Apply mypy improvements to aqt
This commit is contained in:
parent
22ec886e07
commit
a63c9e5a9a
7 changed files with 11 additions and 6 deletions
|
@ -1031,7 +1031,7 @@ class DownloaderInstaller(QObject):
|
||||||
self.client = client
|
self.client = client
|
||||||
self.progressSignal.connect(self._progress_callback) # type: ignore
|
self.progressSignal.connect(self._progress_callback) # type: ignore
|
||||||
|
|
||||||
def bg_thread_progress(up, down):
|
def bg_thread_progress(up, down) -> None:
|
||||||
self.progressSignal.emit(up, down) # type: ignore
|
self.progressSignal.emit(up, down) # type: ignore
|
||||||
|
|
||||||
self.client.progress_hook = bg_thread_progress
|
self.client.progress_hook = bg_thread_progress
|
||||||
|
|
|
@ -1515,7 +1515,7 @@ Please ensure a profile is open and Anki is not busy, then try again."""
|
||||||
# ensure gc runs in main thread
|
# ensure gc runs in main thread
|
||||||
|
|
||||||
def setupDialogGC(self, obj: Any) -> None:
|
def setupDialogGC(self, obj: Any) -> None:
|
||||||
obj.finished.connect(lambda: self.gcWindow(obj)) # type: ignore
|
obj.finished.connect(lambda: self.gcWindow(obj))
|
||||||
|
|
||||||
def gcWindow(self, obj: Any) -> None:
|
def gcWindow(self, obj: Any) -> None:
|
||||||
obj.deleteLater()
|
obj.deleteLater()
|
||||||
|
|
|
@ -115,8 +115,8 @@ class MediaSyncer:
|
||||||
def is_syncing(self) -> bool:
|
def is_syncing(self) -> bool:
|
||||||
return self._syncing
|
return self._syncing
|
||||||
|
|
||||||
def _on_start_stop(self, running: bool):
|
def _on_start_stop(self, running: bool) -> None:
|
||||||
self.mw.toolbar.set_sync_active(running) # type: ignore
|
self.mw.toolbar.set_sync_active(running)
|
||||||
|
|
||||||
def show_sync_log(self):
|
def show_sync_log(self):
|
||||||
aqt.dialogs.open("sync_log", self.mw, self)
|
aqt.dialogs.open("sync_log", self.mw, self)
|
||||||
|
|
|
@ -137,7 +137,7 @@ class ProfileManager:
|
||||||
def find_class(self, module, name):
|
def find_class(self, module, name):
|
||||||
if module == "PyQt5.sip":
|
if module == "PyQt5.sip":
|
||||||
try:
|
try:
|
||||||
import PyQt5.sip # type: ignore # pylint: disable=unused-import
|
import PyQt5.sip # pylint: disable=unused-import
|
||||||
except:
|
except:
|
||||||
# use old sip location
|
# use old sip location
|
||||||
module = "sip"
|
module = "sip"
|
||||||
|
|
|
@ -18,7 +18,7 @@ Closure = Callable[[], None]
|
||||||
class TaskManager(QObject):
|
class TaskManager(QObject):
|
||||||
_closures_pending = pyqtSignal()
|
_closures_pending = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
QObject.__init__(self)
|
QObject.__init__(self)
|
||||||
self._executor = ThreadPoolExecutor()
|
self._executor = ThreadPoolExecutor()
|
||||||
self._closures: List[Closure] = []
|
self._closures: List[Closure] = []
|
||||||
|
|
1
qt/i18n/po
Submodule
1
qt/i18n/po
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 785000d3bd0ee43f79c784b1ebf4dec725eb3cee
|
|
@ -3,6 +3,10 @@ python_version = 3.7
|
||||||
pretty = true
|
pretty = true
|
||||||
no_strict_optional = true
|
no_strict_optional = true
|
||||||
show_error_codes = true
|
show_error_codes = true
|
||||||
|
disallow_untyped_decorators = True
|
||||||
|
warn_redundant_casts = True
|
||||||
|
warn_unused_configs = True
|
||||||
|
warn_unused_ignores = True
|
||||||
|
|
||||||
[mypy-win32file]
|
[mypy-win32file]
|
||||||
ignore_missing_imports = True
|
ignore_missing_imports = True
|
||||||
|
|
Loading…
Reference in a new issue