Changed the plug-in install dialog such, that a data only package directory (i.e. it doesn't contain an __init__.py file) is not deleted before a new plug-in version or variant is installed. 6_1_x

Sat, 15 Oct 2016 16:22:04 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 15 Oct 2016 16:22:04 +0200
branch
6_1_x
changeset 5235
3ea533fbcb4c
parent 5220
0ea031ace7c9
child 5237
56761e8a4d95

Changed the plug-in install dialog such, that a data only package directory (i.e. it doesn't contain an __init__.py file) is not deleted before a new plug-in version or variant is installed.
(grafted from dc9281cba4926b00c83e79b9cd0b162764058bd0)

PluginManager/PluginInstallDialog.py file | annotate | diff | comparison | revisions
--- a/PluginManager/PluginInstallDialog.py	Sun Oct 09 13:40:03 2016 +0200
+++ b/PluginManager/PluginInstallDialog.py	Sat Oct 15 16:22:04 2016 +0200
@@ -393,8 +393,14 @@
             # try to unload a plugin with the same name
             self.__pluginManager.unloadPlugin(installedPluginName)
         
-        # uninstall existing plugin first to get clean conditions
-        self.__uninstallPackage(destination, pluginFileName, packageName)
+        # uninstall existing plug-in first to get clean conditions
+        if packageName != "None" and \
+            not os.path.exists(
+                os.path.join(destination, packageName, "__init__.py")):
+            # package directory contains just data, don't delete it
+            self.__uninstallPackage(destination, pluginFileName, "")
+        else:
+            self.__uninstallPackage(destination, pluginFileName, packageName)
         
         # clean sys.modules
         reload_ = self.__pluginManager.removePluginFromSysModules(

eric ide

mercurial