fix some type errors/lints
This commit is contained in:
parent
339ec45f92
commit
a0ca95a414
@ -462,7 +462,7 @@ def platDesc() -> str:
|
|||||||
elif isWin:
|
elif isWin:
|
||||||
theos = "win:%s" % (platform.win32_ver()[0])
|
theos = "win:%s" % (platform.win32_ver()[0])
|
||||||
elif system == "Linux":
|
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)
|
r = distro.linux_distribution(full_distribution_name=False)
|
||||||
theos = "lin:%s:%s" % (r[0], r[1])
|
theos = "lin:%s:%s" % (r[0], r[1])
|
||||||
|
@ -1105,8 +1105,8 @@ by clicking on one on the left."""
|
|||||||
assert self.col
|
assert self.col
|
||||||
for t in sorted(self.col.tags.all(), key=lambda t: t.lower()):
|
for t in sorted(self.col.tags.all(), key=lambda t: t.lower()):
|
||||||
item = SidebarItem(
|
item = SidebarItem(
|
||||||
t, ":/icons/tag.svg", lambda t=t: self.setFilter("tag", t)
|
t, ":/icons/tag.svg", lambda t=t: self.setFilter("tag", t) # type: ignore
|
||||||
) # type: ignore
|
)
|
||||||
root.addChild(item)
|
root.addChild(item)
|
||||||
|
|
||||||
def _decksTree(self, root) -> None:
|
def _decksTree(self, root) -> None:
|
||||||
@ -1134,8 +1134,8 @@ by clicking on one on the left."""
|
|||||||
item = SidebarItem(
|
item = SidebarItem(
|
||||||
m["name"],
|
m["name"],
|
||||||
":/icons/notetype.svg",
|
":/icons/notetype.svg",
|
||||||
lambda m=m: self.setFilter("note", m["name"]),
|
lambda m=m: self.setFilter("note", m["name"]), # type: ignore
|
||||||
) # type: ignore
|
)
|
||||||
root.addChild(item)
|
root.addChild(item)
|
||||||
|
|
||||||
# Filter tree
|
# Filter tree
|
||||||
|
@ -190,10 +190,8 @@ class Editor:
|
|||||||
if cmd not in self._links:
|
if cmd not in self._links:
|
||||||
self._links[cmd] = func
|
self._links[cmd] = func
|
||||||
if keys:
|
if keys:
|
||||||
QShortcut(
|
QShortcut( # type: ignore
|
||||||
QKeySequence(keys),
|
QKeySequence(keys), self.widget, activated=lambda s=self: func(s),
|
||||||
self.widget, # type: ignore
|
|
||||||
activated=lambda s=self: func(s),
|
|
||||||
)
|
)
|
||||||
btn = self._addButton(
|
btn = self._addButton(
|
||||||
icon,
|
icon,
|
||||||
@ -284,7 +282,7 @@ class Editor:
|
|||||||
runHook("setupEditorShortcuts", cuts, self)
|
runHook("setupEditorShortcuts", cuts, self)
|
||||||
for row in cuts:
|
for row in cuts:
|
||||||
if len(row) == 2:
|
if len(row) == 2:
|
||||||
keys, fn = row
|
keys, fn = row # pylint: disable=unbalanced-tuple-unpacking
|
||||||
fn = self._addFocusCheck(fn)
|
fn = self._addFocusCheck(fn)
|
||||||
else:
|
else:
|
||||||
keys, fn, _ = row
|
keys, fn, _ = row
|
||||||
|
Loading…
Reference in New Issue
Block a user