source: lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins/example.py @ 3060

Last change on this file since 3060 was 3060, checked in by Juanma, 3 years ago

Initial release

File size: 630 bytes
Line 
1#Remember to include the plugin in the __ini__ file
2
3class exampleplugin:
4        def __init__(self):
5                self.example='This is an example plugin'
6                self.dbg=0
7                self.pluginInfo=['example','*']
8        #def __init__
9
10        def set_debug(self,dbg='1'):
11                self.dbg=int(dbg)
12                self.debug ("Debug enabled")
13        #def set_debug
14
15        def debug(self,msg=''):
16                if self.dbg==1:
17                        print ('DEBUG Example: '+msg)
18        #def debug
19
20        def register(self):
21                return(self.pluginInfo)
22
23        def execute_action(self,action):
24                if action=='example':
25                        self.exec_example()
26                return self.example
27
28# <---- Put your code ----> #
29
30        def exec_example(self):
31                self.example="Example executed"
Note: See TracBrowser for help on using the repository browser.