diff --git a/qt/aqt/addons.py b/qt/aqt/addons.py index 23a42a00d..29093ff90 100644 --- a/qt/aqt/addons.py +++ b/qt/aqt/addons.py @@ -47,8 +47,8 @@ class AddonInstallationResult(NamedTuple): class AddonManager: - ext = ".ankiaddon" - _manifest_schema = { + ext: str = ".ankiaddon" + _manifest_schema: dict = { "type": "object", "properties": { "package": {"type": "string", "meta": False}, diff --git a/qt/aqt/main.py b/qt/aqt/main.py index d759cf34a..2cc6cf7ad 100644 --- a/qt/aqt/main.py +++ b/qt/aqt/main.py @@ -1027,6 +1027,7 @@ QTreeWidget { def installAddon(self, path): from aqt.addons import installAddonPackages + installAddonPackages(self.addonManager, [path], external=True, parent=self) # Cramming @@ -1482,7 +1483,7 @@ will be lost. Continue?""" def onAppMsg(self, buf: str) -> Optional[QTimer]: is_addon = buf.endswith(".ankiaddon") - + if self.state == "startup": # try again in a second return self.progress.timer( @@ -1521,13 +1522,13 @@ Please ensure a profile is open and Anki is not busy, then try again.""" self.raise_() if buf == "raise": return None - + # import / add-on installation if is_addon: self.installAddon(buf) else: self.handleImport(buf) - + return None # GC diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index c32c409dc..6b22c8f27 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -57,7 +57,7 @@ def showInfo( type="info", title="Anki", textFormat=None, - customBtns=None + customBtns=None, ): "Show a small info window with an OK button." if parent is False: