/[circus]/circus/circus/module.py
ViewVC logotype

Diff of /circus/circus/module.py

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

revision 1.3 by tvon, Sat Nov 16 03:55:28 2002 UTC revision 1.4 by tvon, Sun Nov 17 03:26:20 2002 UTC
# Line 21  __author__ = "Thomas von Schwerdtner <tv Line 21  __author__ = "Thomas von Schwerdtner <tv
21  __date__ = "Wed Nov 11 2002"  __date__ = "Wed Nov 11 2002"
22  __version__ = "$Revision$"  __version__ = "$Revision$"
23    
24    import sys
25    
26  class Module:  class Module:
27      """Base module class to be inherited by plugin modules"""      """Base module class to be inherited by plugin modules"""
# Line 44  class Module: Line 45  class Module:
45    
46      # overloaded      # overloaded
47      def load(self):      def load(self):
48          # Should raise an exception here (And on unload) if this isnt overloaded          # Should raise an exception here (And on unload) if this isnt
49          print "This method should be overloaded by the plugin"          # overloaded
50            sys.stderr.write("This method should be overloaded by the plugin\n")
51    
52      # overloaded      # overloaded
53      def unload(self):      def unload(self):
54          print "This method should be overloaded by the plugin"          sys.stderr.write("This method should be overloaded by the plugin\n")
55    
56      def _load(self, config, display):      def _load(self, config, display):
57          print "Loading module:", self.__name__          sys.stderr.write("Loading module: " + self.__name__ + "\n")
58          self.config = config          self.config = config
59          self.display = display          self.display = display
60          self.load()          self.load()
61    
62      def _unload(self):      def _unload(self):
63          print "Unloading module:", self.__name__          sys.stderr.write("Unloading module: " + self.__name__ + "\n")
64          self.unload()          self.unload()
65            
66        def _handle_event(self, event):
67            try:
68                self.handle_event(event)
69            except Exception, e:
70                sys.stderr.write("Print exception summary here\n")
71                
72      def handle_exception(self, exception):      def handle_exception(self, exception):
73          print "Should print a summary of info about the module and the exception info here"          sys.stderr.write("An exception occoured:\n")
74          print "An exception occoured:"          sys.stderr.write("Module: " + self.__name__ + "\n")
         print "Module:", self.__name__  
75    
76                    
77    

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

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