26 |
class MyModule(module.Module): |
class MyModule(module.Module): |
27 |
"""A description of your module should be placed here""" |
"""A description of your module should be placed here""" |
28 |
|
|
29 |
|
# A list of actions to make available to other modules |
30 |
|
my_actions = {"example_action" : "demo_action"} |
31 |
|
|
32 |
# A list of events to listen for |
# A list of events to listen for |
33 |
my_events = [X.KeyPress, X.KeyRelease] |
my_events = [X.KeyPress, X.KeyRelease] |
34 |
|
|
35 |
# Any special loading actions should go in here. This will be called |
# Any special loading actions should go in here. This will be called |
36 |
# *after* the module has been instantiated and loaded up into Ringmaster |
# *after* the module has been instantiated and loaded up into Ringmaster |
37 |
def load(self): |
def load(self): |
38 |
pass |
pass |
39 |
|
|
40 |
|
|
41 |
# Any special unloading actions should go in here. This will be called |
# Any special unloading actions should go in here. This will be called |
42 |
# *before* any unloading events occour in Ringmaster |
# *before* any unloading events occour in Ringmaster |
43 |
def unload(self): |
def unload(self): |
44 |
pass |
pass |
45 |
|
|
46 |
|
|
47 |
# This will be called by Ringmaster whenever one of my_events has been |
# This will be called by Ringmaster whenever one of my_events has been |
48 |
# received. Any exceptions that occour in here will be caught by the |
# received. Any exceptions that occour in here will be caught by the |
49 |
# parent Module() |
# parent Module() |
56 |
print "Example received X.KeyRelease" |
print "Example received X.KeyRelease" |
57 |
|
|
58 |
|
|
59 |
|
def demo_action(self): |
60 |
|
print "This is the example app's sample action" |