|
@@ -96,4 +96,22 @@ init_db method: %s"
|
96
|
96
|
msg %= (ds_name, plugin_name, ds_identifier, e)
|
97
|
97
|
logger.info("Database initialisation done for %s(%s.%s)" % (
|
98
|
98
|
ds_name, plugin_name, ds_identifier))
|
99
|
|
-
|
|
99
|
+
|
|
100
|
+def list_registered_hooks():
|
|
101
|
+ import loader
|
|
102
|
+ loader.start()
|
|
103
|
+ from lodel.plugin.hooks import LodelHook
|
|
104
|
+ hlist = LodelHook.hook_list()
|
|
105
|
+ print("Registered hooks are : ")
|
|
106
|
+ for name in sorted(hlist.keys()):
|
|
107
|
+ print("\t- %s is registered by : " % name)
|
|
108
|
+ for reg_hook in hlist[name]:
|
|
109
|
+ hook, priority = reg_hook
|
|
110
|
+ msg = "\t\t- {modname}.{funname} with priority : {priority}"
|
|
111
|
+ msg = msg.format(
|
|
112
|
+ modname = hook.__module__,
|
|
113
|
+ funname = hook.__name__,
|
|
114
|
+ priority = priority)
|
|
115
|
+ print(msg)
|
|
116
|
+ print("\n")
|
|
117
|
+
|