[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Add missing unknown_event stub.



Update of /home/or/cvsroot/control/python
In directory moria:/tmp/cvs-serv6389/python

Modified Files:
	TorCtl.py 
Log Message:
Add missing unknown_event stub.

Index: TorCtl.py
===================================================================
RCS file: /home/or/cvsroot/control/python/TorCtl.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- TorCtl.py	9 Nov 2005 21:23:54 -0000	1.9
+++ TorCtl.py	9 Nov 2005 21:53:36 -0000	1.10
@@ -58,7 +58,7 @@
     def handle0(self, evbody):
         """Dispatcher: called from Connection when an event is received."""
         evtype, args = self.decode0(evbody)
-        self._map0.get(evtype, self.unknownEvent)(evtype, *args)
+        self._map0.get(evtype, self.unknown_event)(evtype, *args)
 
     def decode0(self, body):
         """Unpack an event message into a type/arguments-tuple tuple."""
@@ -104,7 +104,7 @@
         """Dispatcher: called from Connection when an event is received."""
         for code, msg, data in lines:
             evtype, args = self.decode1(msg)
-            self._map1.get(evtype, self.unknownEvent)(evtype, *args)
+            self._map1.get(evtype, self.unknown_event)(evtype, *args)
 
     def decode1(self, body):
         """Unpack an event message into a type/arguments-tuple tuple."""
@@ -161,6 +161,12 @@
 
         return evtype, args
 
+    def unknown_event(self, evtype, *args):
+        """Called when we get an event type we don't recognize.  This
+           is almost alwyas an error.
+        """
+        raise NotImplemented
+
     def circ_status(self, status, circID, path):
         """Called when a circuit status changes if listening to CIRCSTATUS
            events.  'status' is a member of CIRC_STATUS; circID is a numeric