src/eric7/PluginManager/PluginManager.py

branch
eric7
changeset 10314
1f7d52f024b1
parent 10213
0d0683edaf24
child 10372
1444b4bee64b
--- a/src/eric7/PluginManager/PluginManager.py	Thu Nov 16 13:58:04 2023 +0100
+++ b/src/eric7/PluginManager/PluginManager.py	Thu Nov 16 15:56:12 2023 +0100
@@ -186,8 +186,10 @@
         """
         Public method to get the path of a plugin directory.
 
-        @param key key of the plug-in directory (string)
-        @return path of the requested plugin directory (string)
+        @param key key of the plug-in directory
+        @type str
+        @return path of the requested plugin directory
+        @rtype str
         """
         if key not in ["global", "user"]:
             return None
@@ -204,7 +206,8 @@
         If the plugin folders don't exist, they are created (if possible).
 
         @return tuple of a flag indicating existence of any of the plugin
-            directories (boolean) and a message (string)
+            directories and a message
+        @rtype tuple of (bool, str)
         """
         if self.__develPluginFile:
             path = FileSystemUtilities.splitPath(self.__develPluginFile)[0]
@@ -259,7 +262,8 @@
         """
         Private method to check, if there are plugins available.
 
-        @return flag indicating the availability of plugins (boolean)
+        @return flag indicating the availability of plugins
+        @rtype bool
         """
         if self.__develPluginFile and not os.path.exists(self.__develPluginFile):
             return False
@@ -286,8 +290,10 @@
         """
         Public method to get a list of plugin modules.
 
-        @param pluginPath name of the path to search (string)
-        @return list of plugin module names (list of string)
+        @param pluginPath name of the path to search
+        @type str
+        @return list of plugin module names
+        @rtype list of str
         """
         pluginFiles = [
             f[:-3] for f in os.listdir(pluginPath) if self.isValidPluginName(f)
@@ -300,14 +306,16 @@
 
         Plugin modules must start with "Plugin" and have the extension ".py".
 
-        @param pluginName name of the file to be checked (string)
-        @return flag indicating a valid plugin name (boolean)
+        @param pluginName name of the file to be checked
+        @type str
+        @return flag indicating a valid plugin name
+        @rtype bool
         """
         return pluginName.startswith("Plugin") and pluginName.endswith(".py")
 
     def __insertPluginsPaths(self):
         """
-        Private method to insert the valid plugin paths intos the search path.
+        Private method to insert the valid plugin paths into the search path.
         """
         for key in self.__priorityOrder:
             if key in self.pluginDirs:
@@ -468,8 +476,10 @@
         """
         Public method to unload a plugin module.
 
-        @param name name of the module to be unloaded (string)
-        @return flag indicating success (boolean)
+        @param name name of the module to be unloaded
+        @type str
+        @return flag indicating success
+        @rtype bool
         """
         if name in self.__onDemandActiveModules:
             # cannot unload an ondemand plugin, that is in use
@@ -503,11 +513,14 @@
         Public method to remove a plugin and all related modules from
         sys.modules.
 
-        @param pluginName name of the plugin module (string)
-        @param package name of the plugin package (string)
-        @param internalPackages list of intenal packages (list of string)
+        @param pluginName name of the plugin module
+        @type str
+        @param package name of the plugin package
+        @type str
+        @param internalPackages list of intenal packages
+        @type list of str
         @return flag indicating the plugin module was found in sys.modules
-            (boolean)
+        @rtype bool
         """
         packages = [package] + internalPackages
         found = False
@@ -535,7 +548,8 @@
 
         Note: The plug-in is not activated.
 
-        @param name name of the plug-in (string)
+        @param name name of the plug-in
+        @type str
         @exception PluginActivationError raised to indicate an issue during the
             plug-in activation
         """
@@ -565,7 +579,7 @@
         Public method to initialize plug-in toolbars.
 
         @param toolbarManager reference to the toolbar manager object
-            (EricToolBarManager)
+        @type EricToolBarManager
         """
         self.initOnDemandPlugins()
         for pluginObject in self.__onDemandInactivePlugins.values():
@@ -670,8 +684,10 @@
         Private method to check, if a plugin can be activated.
 
         @param module reference to the module to be activated
+        @type Module
         @return flag indicating, if the module satisfies all requirements
-            for being activated (boolean)
+            for being activated
+        @rtype bool
         @exception PluginModuleFormatError raised to indicate an invalid
             plug-in module format
         @exception PluginClassFormatError raised to indicate an invalid
@@ -711,8 +727,10 @@
         Public method to deactivate a plugin.
 
         @param name name of the module to be deactivated
+        @type str
         @param onDemand flag indicating deactivation of an
-            on demand plugin (boolean)
+            on demand plugin
+        @type bool
         """
         try:
             module = (
@@ -751,15 +769,17 @@
         Private method to check, if a plugin can be deactivated.
 
         @param module reference to the module to be deactivated
+        @type Module
         @return flag indicating, if the module satisfies all requirements
-            for being deactivated (boolean)
+            for being deactivated
+        @rtype bool
         """
         return getPluginHeaderEntry(module, "deactivateable", True)
 
     def getPluginObject(self, type_, typename, maybeActive=False):
         """
-        Public method to activate an ondemand plugin given by type and
-        typename.
+        Public method to activate an on-demand plugin given by type and
+        type name.
 
         @param type_ type of the plugin to be activated
         @type str
@@ -868,7 +888,8 @@
         Private method to extract the short info from a module.
 
         @param module module to extract short info from
-        @return dictionay containing plug-in data
+        @type Module
+        @return dictionary containing plug-in data
         @rtype dict ("plugin_name": str, "version": str, "short_desc": str,
             "error": bool)
         """
@@ -883,8 +904,10 @@
         """
         Public method to get detailed information about a plugin.
 
-        @param name name of the module to get detailed infos about (string)
+        @param name name of the module to get detailed infos about
+        @type str
         @return details of the plugin as a dictionary
+        @rtype dict
         """
         details = {}
 
@@ -944,9 +967,10 @@
         Public method to get the display strings of all plugins of a specific
         type.
 
-        @param type_ type of the plugins (string)
+        @param type_ type of the plugins
+        @type str
         @return dictionary with name as key and display string as value
-            (dictionary of string)
+        @rtype dict
         """
         pluginDict = {}
 
@@ -969,9 +993,12 @@
         """
         Public method to get a preview pixmap of a plugin of a specific type.
 
-        @param type_ type of the plugin (string)
-        @param name name of the plugin type (string)
-        @return preview pixmap (QPixmap)
+        @param type_ type of the plugin
+        @type str
+        @param name name of the plugin type
+        @type str
+        @return preview pixmap
+        @rtype QPixmap
         """
         for module in list(self.__onDemandActiveModules.values()) + list(
             self.__onDemandInactiveModules.values()
@@ -991,8 +1018,10 @@
         """
         Public method to get the list of API files installed by a plugin.
 
-        @param language language of the requested API files (string)
-        @return list of API filenames (list of string)
+        @param language language of the requested API files
+        @type str
+        @return list of API filenames
+        @rtype list of str
         """
         apis = []
 
@@ -1055,6 +1084,7 @@
                 <li>text - entry text to be shown (string)</li>
                 <li>version - version text to be shown (string)</li>
             </ul>
+        @rtype list of dict
         """
         infos = []
 
@@ -1106,6 +1136,7 @@
         </dl>
 
         @return plug-in configuration data
+        @rtype dict
         """
         configData = {}
         for module in (
@@ -1121,8 +1152,10 @@
         """
         Public method to check, if a certain plugin is loaded.
 
-        @param pluginName name of the plugin to check for (string)
-        @return flag indicating, if the plugin is loaded (boolean)
+        @param pluginName name of the plugin to check for
+        @type str
+        @return flag indicating, if the plugin is loaded
+        @rtype bool
         """
         return (
             pluginName in self.__activeModules
@@ -1135,8 +1168,10 @@
         """
         Public method to check, if a certain plugin is active.
 
-        @param pluginName name of the plugin to check for (string)
-        @return flag indicating, if the plugin is active (boolean)
+        @param pluginName name of the plugin to check for
+        @type str
+        @return flag indicating, if the plugin is active
+        @rtype bool
         """
         return (
             pluginName in self.__activeModules
@@ -1160,8 +1195,9 @@
         a tuple with the vcs name (string) and vcs display string (string).
 
         @return dictionary with indicator as key and a list of tuples as
-            values. Each tuple contains the vcs name (string) and vcs display
-            string (string).
+            values. Each tuple contains the vcs name (str) and vcs display
+            string (str).
+        @rtype dict
         """
         vcsDict = {}
 
@@ -1351,18 +1387,29 @@
         version,
         filename,
         status,  # noqa: U100
+        category,  # noqa: U100
     ):
         """
         Public method to check a plug-in's data for an update.
 
-        @param name data for the name field (string)
-        @param short data for the short field (string)
-        @param description data for the description field (list of strings)
-        @param url data for the url field (string)
-        @param author data for the author field (string)
-        @param version data for the version field (string)
-        @param filename data for the filename field (string)
-        @param status status of the plugin (string [stable, unstable, unknown])
+        @param name data for the name field
+        @type str
+        @param short data for the short field
+        @type str
+        @param description data for the description field
+        @type list of str
+        @param url data for the url field
+        @type str
+        @param author data for the author field
+        @type str
+        @param version data for the version field
+        @type str
+        @param filename data for the filename field
+        @type str
+        @param status status of the plugin (one of stable, unstable, unknown)
+        @type str
+        @param category category designation of the plugin
+        @type str
         """
         # ignore hidden plug-ins
         pluginName = os.path.splitext(url.rsplit("/", 1)[1])[0]
@@ -1414,8 +1461,10 @@
         """
         Private slot to handle SSL errors.
 
-        @param reply reference to the reply object (QNetworkReply)
-        @param errors list of SSL errors (list of QSslError)
+        @param reply reference to the reply object
+        @type QNetworkReply
+        @param errors list of SSL errors
+        @type list of QSslError
         """
         ignored = self.__sslErrorHandler.sslErrorsReply(reply, errors)[0]
         if ignored == EricSslErrorState.NOT_IGNORED:
@@ -1433,7 +1482,8 @@
         Plugins supporting this functionality must support the module function
         clearPrivateData() and have the module level attribute pluginType.
 
-        @param type_ type of the plugin to clear private data for (string)
+        @param type_ type of the plugin to clear private data for
+        @type str
         """
         for module in (
             list(self.__onDemandActiveModules.values())

eric ide

mercurial