Browse Source

Documentation on the lodel.plugin.core_hooks module

Roland Haroutiounian 7 years ago
parent
commit
0ad3cc59bf
1 changed files with 15 additions and 7 deletions
  1. 15
    7
      lodel/plugin/core_hooks.py

+ 15
- 7
lodel/plugin/core_hooks.py View File

@@ -6,11 +6,15 @@ LodelContext.expose_modules(globals(), {
6 6
     'lodel.settings': ['Settings'],
7 7
     'lodel.logger': 'logger'})
8 8
 
9
-##@package lodel.plugin.core_hooks
10
-#@brief Lodel2 internal hooks declaration
11
-#@ingroup lodel2_plugins
9
+## @package lodel.plugin.core_hooks
10
+# @brief Lodel2 internal hooks declaration
11
+# @ingroup lodel2_plugins
12 12
 
13
-##@brief Bootstrap hook to check datasources configuration
13
+## @brief Bootstrap hook that checks datasources configuration
14
+# @param hook_name str
15
+# @param caller * : the hook's caller
16
+# @param payload * : data to be given to the hook
17
+# @throw NameError when : a set datasource family name can not be found or a datasource identifier does not match with a configured datasource.
14 18
 @LodelHook('lodel2_bootstraped')
15 19
 def datasources_bootstrap_hook(hook_name, caller, payload):
16 20
     for ds_name in Settings.datasources._fields:
@@ -32,12 +36,14 @@ def datasources_bootstrap_hook(hook_name, caller, payload):
32 36
             msg %= identifier
33 37
             raise NameError(msg)
34 38
 
35
-
36 39
         log_msg = "Found a datasource named '%s' identified by '%s'"
37 40
         log_msg %= (ds_name, identifier)
38 41
         logger.debug(log_msg)
39 42
 
40
-##@brief Bootstrap hook that print debug infos about registered hooks
43
+## @brief Bootstrap hook that prints debug infos about registered hooks
44
+# @param name str
45
+# @param caller * : the hook's caller
46
+# @param payload * : data to be given to the hook
41 47
 @LodelHook('lodel2_bootstraped')
42 48
 def list_hook_debug_hook(name, caller, payload):
43 49
     LodelContext.expose_modules(globals(), {
@@ -55,7 +61,9 @@ def list_hook_debug_hook(name, caller, payload):
55 61
         
56 62
 
57 63
 
58
-##@brief Hooks that trigger custom methods injection in dynmic classes
64
+## @brief Hook that triggers custom methods injection in dynamic classes
65
+# @param caller * : the hook's caller
66
+# @param dynclasses list : a list of classes in which the injection will occur
59 67
 @LodelHook("lodel2_dyncode_loaded")
60 68
 def lodel2_plugins_custom_methods(self, caller, dynclasses):
61 69
     LodelContext.expose_modules(globals(), {

Loading…
Cancel
Save