PluginManager, QtHelpDocumentationDialog: fixed loading plug-in documentation sets when run stand-alone.

Fri, 14 Dec 2018 19:52:38 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 14 Dec 2018 19:52:38 +0100
changeset 6629
643ec3a53d17
parent 6628
c3f0f6bffd21
child 6630
bddd12f27a4c

PluginManager, QtHelpDocumentationDialog: fixed loading plug-in documentation sets when run stand-alone.

PluginManager/PluginManager.py file | annotate | diff | comparison | revisions
WebBrowser/QtHelp/QtHelpDocumentationDialog.py file | annotate | diff | comparison | revisions
--- a/PluginManager/PluginManager.py	Fri Dec 14 19:51:12 2018 +0100
+++ b/PluginManager/PluginManager.py	Fri Dec 14 19:52:38 2018 +0100
@@ -338,6 +338,36 @@
             self.loadPlugin(develPluginName, develPluginPath)
             self.__develPluginName = develPluginName
     
+    def loadDocumentationSetPlugins(self):
+        """
+        Public method to load just the documentation sets plugins.
+        
+        @exception PluginModulesError raised to indicate the absence of
+            plug-in modules
+        """
+        if not self.__pluginModulesExist():
+            raise PluginModulesError
+        
+        self.__insertPluginsPaths()
+        
+        for pluginName in self.__foundGlobalModules:
+            # user and core plug-ins have priority
+            if pluginName not in self.__foundUserModules and \
+               pluginName not in self.__foundCoreModules and \
+               pluginName.startswith("PluginDocumentationSets"):
+                self.loadPlugin(pluginName, self.pluginDirs["global"])
+        
+        for pluginName in self.__foundUserModules:
+            # core plug-ins have priority
+            if pluginName not in self.__foundCoreModules and \
+               pluginName.startswith("PluginDocumentationSets"):
+                self.loadPlugin(pluginName, self.pluginDirs["user"])
+        
+        for pluginName in self.__foundCoreModules:
+            # plug-in under development has priority
+            if pluginName.startswith("PluginDocumentationSets"):
+                self.loadPlugin(pluginName, self.pluginDirs["eric6"])
+    
     def loadPlugin(self, name, directory, reload_=False):
         """
         Public method to load a plugin module.
--- a/WebBrowser/QtHelp/QtHelpDocumentationDialog.py	Fri Dec 14 19:51:12 2018 +0100
+++ b/WebBrowser/QtHelp/QtHelpDocumentationDialog.py	Fri Dec 14 19:52:38 2018 +0100
@@ -50,8 +50,10 @@
                 e5App().getObject("PluginManager").getPluginQtHelpFiles()
         except KeyError:
             from PluginManager.PluginManager import PluginManager
-            self.__pluginHelpDocuments = \
-                PluginManager(self).getPluginQtHelpFiles()
+            pluginManager = PluginManager(self, doLoadPlugins=False)
+            pluginManager.loadDocumentationSetPlugins()
+            pluginManager.activatePlugins()
+            self.__pluginHelpDocuments = pluginManager.getPluginQtHelpFiles()
         self.addPluginButton.setEnabled(bool(self.__pluginHelpDocuments))
     
     @pyqtSlot()

eric ide

mercurial