Browse Source

Documentation on the lodel.plugin.interface module

Roland Haroutiounian 7 years ago
parent
commit
bdbb76e10e
1 changed files with 12 additions and 4 deletions
  1. 12
    4
      lodel/plugin/interface.py

+ 12
- 4
lodel/plugin/interface.py View File

1
+## @package lodel.plugin.interface Handles the Interface type plugins
2
+
1
 from lodel.context import LodelContext
3
 from lodel.context import LodelContext
2
 LodelContext.expose_modules(globals(), {
4
 LodelContext.expose_modules(globals(), {
3
     'lodel.plugin.plugins': ['Plugin'],
5
     'lodel.plugin.plugins': ['Plugin'],
5
         'LodelScriptError', 'DatasourcePluginError'],
7
         'LodelScriptError', 'DatasourcePluginError'],
6
     'lodel.validator.validator': ['Validator']})
8
     'lodel.validator.validator': ['Validator']})
7
 
9
 
10
+## @brief Global type name used in the settings of Lodel for this type of plugins
8
 _glob_typename = 'ui'
11
 _glob_typename = 'ui'
9
 
12
 
10
 
13
 
11
-##@brief Handles interfaces plugin
14
+##@brief A plugin Interface
12
 #@note It's a singleton class. Only 1 interface allowed by instance.
15
 #@note It's a singleton class. Only 1 interface allowed by instance.
13
 class InterfacePlugin(Plugin):
16
 class InterfacePlugin(Plugin):
14
     
17
     
15
-    ##@brief Singleton instance storage
18
+    ## @brief Singleton instance storage
16
     _instance = None
19
     _instance = None
17
 
20
 
21
+    ## @brief Settings description
18
     _plist_confspecs = {
22
     _plist_confspecs = {
19
         'section': 'lodel2',
23
         'section': 'lodel2',
20
         'key': 'interface',
24
         'key': 'interface',
22
         'validator': Validator(
26
         'validator': Validator(
23
             'plugin', none_is_valid = True, ptype = _glob_typename)}
27
             'plugin', none_is_valid = True, ptype = _glob_typename)}
24
 
28
 
29
+    ## @brief plugin type name
25
     _type_conf_name = _glob_typename
30
     _type_conf_name = _glob_typename
26
     
31
     
32
+    ##
33
+    # @param name str : Name of the interface plugin
34
+    # @throw PluginError if there is already an interface plugin instanciated
27
     def __init__(self, name):
35
     def __init__(self, name):
28
         if InterfacePlugin._instance is not None:
36
         if InterfacePlugin._instance is not None:
29
             raise PluginError("Maximum one interface allowed")
37
             raise PluginError("Maximum one interface allowed")
30
         super().__init__(name)
38
         super().__init__(name)
31
         self._instance = self
39
         self._instance = self
32
 
40
 
33
-    ##@brief Clear class
34
-    #@see plugins.Plugin::clear()
41
+    ## @brief Clears the singleton from its active instance
42
+    # @see plugins.Plugin::clear()
35
     @classmethod
43
     @classmethod
36
     def clear_cls(cls):
44
     def clear_cls(cls):
37
         if cls._instance is not None:
45
         if cls._instance is not None:

Loading…
Cancel
Save