Merge remote-tracking branch 'danielelmes/master' into fix_windows_build

# Conflicts:
#	CONTRIBUTORS
This commit is contained in:
evandrocoan 2020-02-27 00:54:16 -03:00
commit ba3a84f89a
11 changed files with 18 additions and 8 deletions

View File

@ -27,6 +27,7 @@ Yngve Hoiseth <yngve@hoiseth.net>
Ijgnd
Yoonchae Lee
Evandro Coan <github.com/evandrocoan>
Alan Du <alanhdu@gmail.com>
********************

View File

@ -183,7 +183,7 @@ class _Collection:
select crt, mod, scm, dty, usn, ls,
conf, models, decks, dconf, tags from col"""
)
self.conf = json.loads(conf) # type: ignore
self.conf = json.loads(conf)
self.models.load(models)
self.decks.load(decks, dconf)
self.tags.load(tags)

View File

@ -152,7 +152,7 @@ def fields_for_rendering(col: anki.storage._Collection, card: Card, note: Note):
fields["Type"] = card.note_type()["name"]
fields["Deck"] = col.decks.name(card.odid or card.did)
fields["Subdeck"] = fields["Deck"].split("::")[-1]
fields["Card"] = card.template()["name"] # type: ignore
fields["Card"] = card.template()["name"]
flag = card.userFlag()
fields["CardFlag"] = flag and f"flag{flag}" or ""
fields["c%d" % (card.ord + 1)] = "1"

View File

@ -4,6 +4,10 @@ pretty = false
no_strict_optional = true
show_error_codes = true
check_untyped_defs = true
disallow_untyped_decorators = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unused_ignores = True
[mypy-win32file]
ignore_missing_imports = True

View File

@ -1031,7 +1031,7 @@ class DownloaderInstaller(QObject):
self.client = client
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.client.progress_hook = bg_thread_progress

View File

@ -1515,7 +1515,7 @@ Please ensure a profile is open and Anki is not busy, then try again."""
# ensure gc runs in main thread
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:
obj.deleteLater()

View File

@ -115,8 +115,8 @@ class MediaSyncer:
def is_syncing(self) -> bool:
return self._syncing
def _on_start_stop(self, running: bool):
self.mw.toolbar.set_sync_active(running) # type: ignore
def _on_start_stop(self, running: bool) -> None:
self.mw.toolbar.set_sync_active(running)
def show_sync_log(self):
aqt.dialogs.open("sync_log", self.mw, self)

View File

@ -137,7 +137,7 @@ class ProfileManager:
def find_class(self, module, name):
if module == "PyQt5.sip":
try:
import PyQt5.sip # type: ignore # pylint: disable=unused-import
import PyQt5.sip # pylint: disable=unused-import
except:
# use old sip location
module = "sip"

View File

@ -18,7 +18,7 @@ Closure = Callable[[], None]
class TaskManager(QObject):
_closures_pending = pyqtSignal()
def __init__(self):
def __init__(self) -> None:
QObject.__init__(self)
self._executor = ThreadPoolExecutor()
self._closures: List[Closure] = []

1
qt/i18n/po Submodule

@ -0,0 +1 @@
Subproject commit 785000d3bd0ee43f79c784b1ebf4dec725eb3cee

View File

@ -3,6 +3,10 @@ python_version = 3.7
pretty = true
no_strict_optional = true
show_error_codes = true
disallow_untyped_decorators = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unused_ignores = True
[mypy-win32file]
ignore_missing_imports = True