fix some type errors/lints

This commit is contained in:
Damien Elmes 2019-12-23 11:31:42 +10:00
parent 339ec45f92
commit a0ca95a414
3 changed files with 8 additions and 10 deletions

View File

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

View File

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

View File

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