|
@@ -9,7 +9,7 @@ from lodel import logger
|
9
|
9
|
|
10
|
10
|
##@brief Bootstrap hook to check datasources configuration
|
11
|
11
|
@LodelHook('lodel2_bootstraped')
|
12
|
|
-def datasources_bootstrap_callaback(hook_name, caller, payload):
|
|
12
|
+def datasources_bootstrap_hook(hook_name, caller, payload):
|
13
|
13
|
for ds_name in Settings.datasources._fields:
|
14
|
14
|
ds_conf = getattr(Settings.datasources, ds_name)
|
15
|
15
|
identifier = getattr(ds_conf, 'identifier')
|
|
@@ -34,6 +34,25 @@ def datasources_bootstrap_callaback(hook_name, caller, payload):
|
34
|
34
|
log_msg %= (ds_name, identifier)
|
35
|
35
|
logger.debug(log_msg)
|
36
|
36
|
|
|
37
|
+##@brief Bootstrap hook that print debug infos about registered hooks
|
|
38
|
+@LodelHook('lodel2_bootstraped')
|
|
39
|
+def list_hook_debug_hook(name, caller, payload):
|
|
40
|
+ from lodel.auth.auth import Auth
|
|
41
|
+ from lodel import logger
|
|
42
|
+ hlist = LodelHook.hook_list()
|
|
43
|
+ for name, reg_hooks in hlist.items():
|
|
44
|
+ for hook, priority in reg_hooks:
|
|
45
|
+ logger.debug("{modname}.{funname} is registered as hook \
|
|
46
|
+{hookname} with priority {priority}".format(
|
|
47
|
+ modname = hook.__module__,
|
|
48
|
+ funname = hook.__name__,
|
|
49
|
+ priority = priority,
|
|
50
|
+ hookname = name))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+##@brief Hooks that trigger custom methods injection in dynmic classes
|
37
|
56
|
@LodelHook("lodel2_dyncode_loaded")
|
38
|
57
|
def lodel2_plugins_custom_methods(self, caller, dynclasses):
|
39
|
58
|
from lodel.plugin.plugins import CustomMethod
|