eric7/PluginManager/PluginManager.py

branch
eric7
changeset 8314
e3642a6a1e71
parent 8312
800c432b34c8
child 8318
962bce857696
diff -r dac33c7fce07 -r e3642a6a1e71 eric7/PluginManager/PluginManager.py
--- a/eric7/PluginManager/PluginManager.py	Sat May 15 19:01:16 2021 +0200
+++ b/eric7/PluginManager/PluginManager.py	Sat May 15 20:08:03 2021 +0200
@@ -43,7 +43,7 @@
 import Utilities
 import Preferences
 
-from eric6config import getConfig
+from eric7config import getConfig
 
 
 class PluginManager(QObject):
@@ -75,10 +75,10 @@
         Constructor
         
         The Plugin Manager deals with three different plugin directories.
-        The first is the one, that is part of eric6 (eric6/Plugins). The
-        second one is the global plugin directory called 'eric6plugins',
+        The first is the one, that is part of eric7 (eric7/Plugins). The
+        second one is the global plugin directory called 'eric7plugins',
         which is located inside the site-packages directory. The last one
-        is the user plugin directory located inside the .eric6 directory
+        is the user plugin directory located inside the .eric7 directory
         of the users home directory.
         
         @param parent reference to the parent object
@@ -109,12 +109,12 @@
         self.__inactivePluginsKey = "PluginManager/InactivePlugins"
         
         self.pluginDirs = {
-            "eric6": os.path.join(getConfig('ericDir'), "Plugins"),
+            "eric7": os.path.join(getConfig('ericDir'), "Plugins"),
             "global": os.path.join(Utilities.getPythonLibraryDirectory(),
-                                   "eric6plugins"),
-            "user": os.path.join(Utilities.getConfigDir(), "eric6plugins"),
+                                   "eric7plugins"),
+            "user": os.path.join(Utilities.getConfigDir(), "eric7plugins"),
         }
-        self.__priorityOrder = ["eric6", "global", "user"]
+        self.__priorityOrder = ["eric7", "global", "user"]
         
         self.__defaultDownloadDir = os.path.join(
             Utilities.getConfigDir(), "Downloads")
@@ -236,12 +236,12 @@
             except OSError:
                 del self.pluginDirs["global"]
         
-        if not os.path.exists(self.pluginDirs["eric6"]):
+        if not os.path.exists(self.pluginDirs["eric7"]):
             return (
                 False,
                 self.tr(
                     "The internal plugin directory <b>{0}</b>"
-                    " does not exits.").format(self.pluginDirs["eric6"]))
+                    " does not exits.").format(self.pluginDirs["eric7"]))
         
         return (True, "")
     
@@ -258,7 +258,7 @@
             return False
         
         self.__foundCoreModules = self.getPluginModules(
-            self.pluginDirs["eric6"])
+            self.pluginDirs["eric7"])
         if Preferences.getPluginManager("ActivateExternal"):
             if "global" in self.pluginDirs:
                 self.__foundGlobalModules = self.getPluginModules(
@@ -339,7 +339,7 @@
         for pluginName in self.__foundCoreModules:
             # plug-in under development has priority
             if pluginName != develPluginName:
-                self.loadPlugin(pluginName, self.pluginDirs["eric6"])
+                self.loadPlugin(pluginName, self.pluginDirs["eric7"])
         
         if develPluginName:
             self.loadPlugin(develPluginName, develPluginPath)
@@ -377,7 +377,7 @@
         for pluginName in self.__foundCoreModules:
             # plug-in under development has priority
             if pluginName.startswith("PluginDocumentationSets"):
-                self.loadPlugin(pluginName, self.pluginDirs["eric6"])
+                self.loadPlugin(pluginName, self.pluginDirs["eric7"])
     
     def loadPlugin(self, name, directory, reload_=False, install=False):
         """
@@ -426,8 +426,8 @@
                     raise PluginLoadError(name)
                 else:
                     self.__onDemandInactiveModules[name] = module
-            module.eric6PluginModuleName = name
-            module.eric6PluginModuleFilename = fname
+            module.eric7PluginModuleName = name
+            module.eric7PluginModuleFilename = fname
             if install and hasattr(module, "installDependencies"):
                 # ask the module to install its dependencies
                 module.installDependencies(self.pipInstall)
@@ -535,16 +535,16 @@
                 return
             
             if not self.__canActivatePlugin(module):
-                raise PluginActivationError(module.eric6PluginModuleName)
+                raise PluginActivationError(module.eric7PluginModuleName)
             version = getattr(module, "version", "0.0.0")
             className = getattr(module, "className", "")
             pluginClass = getattr(module, className)
             pluginObject = None
             if name not in self.__onDemandInactivePlugins:
                 pluginObject = pluginClass(self.__ui)
-                pluginObject.eric6PluginModule = module
-                pluginObject.eric6PluginName = className
-                pluginObject.eric6PluginVersion = version
+                pluginObject.eric7PluginModule = module
+                pluginObject.eric7PluginName = className
+                pluginObject.eric7PluginVersion = version
                 self.__onDemandInactivePlugins[name] = pluginObject
         except PluginActivationError:
             return
@@ -605,7 +605,7 @@
                 return None
             
             if not self.__canActivatePlugin(module):
-                raise PluginActivationError(module.eric6PluginModuleName)
+                raise PluginActivationError(module.eric7PluginModuleName)
             version = getattr(module, "version", "0.0.0")
             className = getattr(module, "className", "")
             pluginClass = getattr(module, className)
@@ -632,9 +632,9 @@
                 return None
             
             self.pluginActivated.emit(name, pluginObject)
-            pluginObject.eric6PluginModule = module
-            pluginObject.eric6PluginName = className
-            pluginObject.eric6PluginVersion = version
+            pluginObject.eric7PluginModule = module
+            pluginObject.eric7PluginName = className
+            pluginObject.eric7PluginVersion = version
             
             if onDemand:
                 self.__onDemandInactiveModules.pop(name)
@@ -667,26 +667,26 @@
         try:
             if not hasattr(module, "version"):
                 raise PluginModuleFormatError(
-                    module.eric6PluginModuleName, "version")
+                    module.eric7PluginModuleName, "version")
             if not hasattr(module, "className"):
                 raise PluginModuleFormatError(
-                    module.eric6PluginModuleName, "className")
+                    module.eric7PluginModuleName, "className")
             className = getattr(module, "className", "")
             if not className or not hasattr(module, className):
                 raise PluginModuleFormatError(
-                    module.eric6PluginModuleName, className)
+                    module.eric7PluginModuleName, className)
             pluginClass = getattr(module, className)
             if not hasattr(pluginClass, "__init__"):
                 raise PluginClassFormatError(
-                    module.eric6PluginModuleName,
+                    module.eric7PluginModuleName,
                     className, "__init__")
             if not hasattr(pluginClass, "activate"):
                 raise PluginClassFormatError(
-                    module.eric6PluginModuleName,
+                    module.eric7PluginModuleName,
                     className, "activate")
             if not hasattr(pluginClass, "deactivate"):
                 raise PluginClassFormatError(
-                    module.eric6PluginModuleName,
+                    module.eric7PluginModuleName,
                     className, "deactivate")
             return True
         except PluginModuleFormatError as e:
@@ -892,7 +892,7 @@
         
         details["moduleName"] = name
         details["moduleFileName"] = getattr(
-            module, "eric6PluginModuleFilename", "")
+            module, "eric7PluginModuleFilename", "")
         details["pluginName"] = getattr(module, "name", "")
         details["version"] = getattr(module, "version", "")
         details["author"] = getattr(module, "author", "")

eric ide

mercurial