mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix mypy and black checks
This commit is contained in:
parent
57c48d7c85
commit
1b236acb3d
3 changed files with 7 additions and 6 deletions
|
@ -47,8 +47,8 @@ class AddonInstallationResult(NamedTuple):
|
||||||
|
|
||||||
class AddonManager:
|
class AddonManager:
|
||||||
|
|
||||||
ext = ".ankiaddon"
|
ext: str = ".ankiaddon"
|
||||||
_manifest_schema = {
|
_manifest_schema: dict = {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"package": {"type": "string", "meta": False},
|
"package": {"type": "string", "meta": False},
|
||||||
|
|
|
@ -1027,6 +1027,7 @@ QTreeWidget {
|
||||||
|
|
||||||
def installAddon(self, path):
|
def installAddon(self, path):
|
||||||
from aqt.addons import installAddonPackages
|
from aqt.addons import installAddonPackages
|
||||||
|
|
||||||
installAddonPackages(self.addonManager, [path], external=True, parent=self)
|
installAddonPackages(self.addonManager, [path], external=True, parent=self)
|
||||||
|
|
||||||
# Cramming
|
# Cramming
|
||||||
|
@ -1482,7 +1483,7 @@ will be lost. Continue?"""
|
||||||
|
|
||||||
def onAppMsg(self, buf: str) -> Optional[QTimer]:
|
def onAppMsg(self, buf: str) -> Optional[QTimer]:
|
||||||
is_addon = buf.endswith(".ankiaddon")
|
is_addon = buf.endswith(".ankiaddon")
|
||||||
|
|
||||||
if self.state == "startup":
|
if self.state == "startup":
|
||||||
# try again in a second
|
# try again in a second
|
||||||
return self.progress.timer(
|
return self.progress.timer(
|
||||||
|
@ -1521,13 +1522,13 @@ Please ensure a profile is open and Anki is not busy, then try again."""
|
||||||
self.raise_()
|
self.raise_()
|
||||||
if buf == "raise":
|
if buf == "raise":
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# import / add-on installation
|
# import / add-on installation
|
||||||
if is_addon:
|
if is_addon:
|
||||||
self.installAddon(buf)
|
self.installAddon(buf)
|
||||||
else:
|
else:
|
||||||
self.handleImport(buf)
|
self.handleImport(buf)
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# GC
|
# GC
|
||||||
|
|
|
@ -57,7 +57,7 @@ def showInfo(
|
||||||
type="info",
|
type="info",
|
||||||
title="Anki",
|
title="Anki",
|
||||||
textFormat=None,
|
textFormat=None,
|
||||||
customBtns=None
|
customBtns=None,
|
||||||
):
|
):
|
||||||
"Show a small info window with an OK button."
|
"Show a small info window with an OK button."
|
||||||
if parent is False:
|
if parent is False:
|
||||||
|
|
Loading…
Reference in a new issue