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 Ijgnd
Yoonchae Lee Yoonchae Lee
Evandro Coan <github.com/evandrocoan> 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, select crt, mod, scm, dty, usn, ls,
conf, models, decks, dconf, tags from col""" conf, models, decks, dconf, tags from col"""
) )
self.conf = json.loads(conf) # type: ignore self.conf = json.loads(conf)
self.models.load(models) self.models.load(models)
self.decks.load(decks, dconf) self.decks.load(decks, dconf)
self.tags.load(tags) 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["Type"] = card.note_type()["name"]
fields["Deck"] = col.decks.name(card.odid or card.did) fields["Deck"] = col.decks.name(card.odid or card.did)
fields["Subdeck"] = fields["Deck"].split("::")[-1] fields["Subdeck"] = fields["Deck"].split("::")[-1]
fields["Card"] = card.template()["name"] # type: ignore fields["Card"] = card.template()["name"]
flag = card.userFlag() flag = card.userFlag()
fields["CardFlag"] = flag and f"flag{flag}" or "" fields["CardFlag"] = flag and f"flag{flag}" or ""
fields["c%d" % (card.ord + 1)] = "1" fields["c%d" % (card.ord + 1)] = "1"

View file

@ -4,6 +4,10 @@ pretty = false
no_strict_optional = true no_strict_optional = true
show_error_codes = true show_error_codes = true
check_untyped_defs = true check_untyped_defs = 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

View file

@ -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

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 # 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()

View file

@ -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)

View file

@ -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"

View file

@ -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

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

View file

@ -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