[Neo-report] r1863 gregory - in /trunk/neo: handler.py protocol.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Feb 26 14:00:11 CET 2010


Author: gregory
Date: Fri Feb 26 14:00:05 2010
New Revision: 1863

Log:
Implement a simple __repr__ on Packet and Handler classes.

Modified:
    trunk/neo/handler.py
    trunk/neo/protocol.py

Modified: trunk/neo/handler.py
==============================================================================
--- trunk/neo/handler.py [iso-8859-1] (original)
+++ trunk/neo/handler.py [iso-8859-1] Fri Feb 26 14:00:05 2010
@@ -28,6 +28,9 @@
         self.app = app
         self.packet_dispatch_table = self.__initPacketDispatchTable()
         self.error_dispatch_table = self.__initErrorDispatchTable()
+
+    def __repr__(self):
+        return self.__class__.__name__
 
     def _packetMalformed(self, conn, message='', *args):
         """Called when a packet is malformed."""

Modified: trunk/neo/protocol.py
==============================================================================
--- trunk/neo/protocol.py [iso-8859-1] (original)
+++ trunk/neo/protocol.py [iso-8859-1] Fri Feb 26 14:00:05 2010
@@ -272,6 +272,9 @@
 
     def __len__(self):
         return PACKET_HEADER_SIZE + len(self._body)
+
+    def __repr__(self):
+        return self.__class__.__name__
 
     def __eq__(self, other):
         """ Compare packets with their code instead of content """





More information about the Neo-report mailing list