/[circus]/circus/modules/CircusExample/example.py
ViewVC logotype

Diff of /circus/modules/CircusExample/example.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by tvon, Sun Nov 17 03:42:38 2002 UTC revision 1.5 by tvon, Sun Nov 17 23:12:24 2002 UTC
# Line 26  from circus import module Line 26  from circus import module
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()
# Line 51  class MyModule(module.Module): Line 56  class MyModule(module.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"

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26