From bdbb76e10e16ab7a7aec0a64b7cc3a3c5035f778 Mon Sep 17 00:00:00 2001 From: Roland Haroutiounian Date: Fri, 24 Mar 2017 17:15:18 +0100 Subject: [PATCH] Documentation on the lodel.plugin.interface module --- lodel/plugin/interface.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lodel/plugin/interface.py b/lodel/plugin/interface.py index feb0aac..64ac9ea 100644 --- a/lodel/plugin/interface.py +++ b/lodel/plugin/interface.py @@ -1,3 +1,5 @@ +## @package lodel.plugin.interface Handles the Interface type plugins + from lodel.context import LodelContext LodelContext.expose_modules(globals(), { 'lodel.plugin.plugins': ['Plugin'], @@ -5,16 +7,18 @@ LodelContext.expose_modules(globals(), { 'LodelScriptError', 'DatasourcePluginError'], 'lodel.validator.validator': ['Validator']}) +## @brief Global type name used in the settings of Lodel for this type of plugins _glob_typename = 'ui' -##@brief Handles interfaces plugin +##@brief A plugin Interface #@note It's a singleton class. Only 1 interface allowed by instance. class InterfacePlugin(Plugin): - ##@brief Singleton instance storage + ## @brief Singleton instance storage _instance = None + ## @brief Settings description _plist_confspecs = { 'section': 'lodel2', 'key': 'interface', @@ -22,16 +26,20 @@ class InterfacePlugin(Plugin): 'validator': Validator( 'plugin', none_is_valid = True, ptype = _glob_typename)} + ## @brief plugin type name _type_conf_name = _glob_typename + ## + # @param name str : Name of the interface plugin + # @throw PluginError if there is already an interface plugin instanciated def __init__(self, name): if InterfacePlugin._instance is not None: raise PluginError("Maximum one interface allowed") super().__init__(name) self._instance = self - ##@brief Clear class - #@see plugins.Plugin::clear() + ## @brief Clears the singleton from its active instance + # @see plugins.Plugin::clear() @classmethod def clear_cls(cls): if cls._instance is not None: