From a0ca95a41459af0bb8aed746cabc413568ed1f45 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 23 Dec 2019 11:31:42 +1000 Subject: [PATCH] fix some type errors/lints --- anki/utils.py | 2 +- aqt/browser.py | 8 ++++---- aqt/editor.py | 8 +++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/anki/utils.py b/anki/utils.py index 1eaec51a5..7e301ea5e 100644 --- a/anki/utils.py +++ b/anki/utils.py @@ -462,7 +462,7 @@ def platDesc() -> str: elif isWin: theos = "win:%s" % (platform.win32_ver()[0]) elif system == "Linux": - import distro # pytype: disable=import-error + import distro # pytype: disable=import-error # pylint: disable=import-error r = distro.linux_distribution(full_distribution_name=False) theos = "lin:%s:%s" % (r[0], r[1]) diff --git a/aqt/browser.py b/aqt/browser.py index 0329f31b2..b8ad9d21e 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -1105,8 +1105,8 @@ by clicking on one on the left.""" assert self.col for t in sorted(self.col.tags.all(), key=lambda t: t.lower()): item = SidebarItem( - t, ":/icons/tag.svg", lambda t=t: self.setFilter("tag", t) - ) # type: ignore + t, ":/icons/tag.svg", lambda t=t: self.setFilter("tag", t) # type: ignore + ) root.addChild(item) def _decksTree(self, root) -> None: @@ -1134,8 +1134,8 @@ by clicking on one on the left.""" item = SidebarItem( m["name"], ":/icons/notetype.svg", - lambda m=m: self.setFilter("note", m["name"]), - ) # type: ignore + lambda m=m: self.setFilter("note", m["name"]), # type: ignore + ) root.addChild(item) # Filter tree diff --git a/aqt/editor.py b/aqt/editor.py index a91e52efe..b6ddef868 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -190,10 +190,8 @@ class Editor: if cmd not in self._links: self._links[cmd] = func if keys: - QShortcut( - QKeySequence(keys), - self.widget, # type: ignore - activated=lambda s=self: func(s), + QShortcut( # type: ignore + QKeySequence(keys), self.widget, activated=lambda s=self: func(s), ) btn = self._addButton( icon, @@ -284,7 +282,7 @@ class Editor: runHook("setupEditorShortcuts", cuts, self) for row in cuts: if len(row) == 2: - keys, fn = row + keys, fn = row # pylint: disable=unbalanced-tuple-unpacking fn = self._addFocusCheck(fn) else: keys, fn, _ = row