|
@@ -1,10 +1,18 @@
|
1
|
1
|
#-*- coding: utf-8 -*-
|
2
|
2
|
|
|
3
|
+## @package lodel.plugins.dummy.main Plugin's loader module
|
|
4
|
+
|
3
|
5
|
from lodel.context import LodelContext
|
4
|
6
|
LodelContext.expose_modules(globals(), {
|
5
|
7
|
'lodel.plugin': ['LodelHook', 'CustomMethod'],
|
6
|
8
|
'lodel.settings' : 'settings'})
|
7
|
9
|
|
|
10
|
+
|
|
11
|
+## @brief callback method using lodel's hook system
|
|
12
|
+# @param hook_name str
|
|
13
|
+# @param caller function : action to perform
|
|
14
|
+# @param payload : data to pass to the caller
|
|
15
|
+# @return payload
|
8
|
16
|
@LodelHook('leapi_get_post')
|
9
|
17
|
@LodelHook('leapi_update_pre')
|
10
|
18
|
@LodelHook('leapi_update_post')
|
|
@@ -17,15 +25,17 @@ def dummy_callback(hook_name, caller, payload):
|
17
|
25
|
print("\tHook %s\tcaller %s with %s" % (hook_name, caller, payload))
|
18
|
26
|
return payload
|
19
|
27
|
|
20
|
|
-
|
|
28
|
+## @brief instance method
|
|
29
|
+# This is an example of a basic plugin's custom method
|
21
|
30
|
@CustomMethod('Object', 'dummy_method')
|
22
|
31
|
def dummy_instance_method(self):
|
23
|
32
|
print("Hello world !\
|
24
|
33
|
I'm a custom method on an instance of class %s" % self.__class__)
|
25
|
34
|
|
26
|
35
|
|
|
36
|
+## @brief instance method
|
|
37
|
+# This is an example of a basic plugin's custom method
|
27
|
38
|
@CustomMethod('Object', 'dummy_class_method', CustomMethod.CLASS_METHOD)
|
28
|
39
|
def dummy_instance_method(self):
|
29
|
40
|
print("Hello world !\
|
30
|
41
|
I'm a custom method on class %s" % self.__class__)
|
31
|
|
-
|