From 89a9830d79556dbe554d95cc09e0da9f283a7bd9 Mon Sep 17 00:00:00 2001 From: yan Date: Thu, 7 Jan 2021 12:00:57 +0100 Subject: [PATCH] Finally fixes auto-update feature --- addon/globalPlugins/translate/__init__.py | 3 +++ buildVars.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addon/globalPlugins/translate/__init__.py b/addon/globalPlugins/translate/__init__.py index f431c68..1896e84 100644 --- a/addon/globalPlugins/translate/__init__.py +++ b/addon/globalPlugins/translate/__init__.py @@ -358,6 +358,9 @@ def onTimer(self): filepath = evt.get("download", None) if filepath is not None: import addonHandler + for prev in addonHandler.getAvailableAddons(): + if prev.name == updater.ADDON_NAME: + prev.requestRemove() bundle = addonHandler.AddonBundle(filepath) addonHandler.installAddonBundle(bundle) logHandler.log.info("Installed version %s, restart NVDA to make the changes permanent" %(evt["version"])) diff --git a/buildVars.py b/buildVars.py index 433b543..5bcdf56 100644 --- a/buildVars.py +++ b/buildVars.py @@ -20,7 +20,7 @@ "addon_description" : _("""Uses the Google Translate API to translate each spoken text to the desired language, on the fly. This add-on requires an internet connection."""), # version - "addon_version" : "2021.01.2", + "addon_version" : "2021.01.3", # Author(s) "addon_author" : u"Yannick PLASSIARD , Hxebolax", # URL for the add-on documentation support