[Neo-report] r1845 gregory - /trunk/neo/protocol.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 23 16:59:37 CET 2010


Author: gregory
Date: Tue Feb 23 16:59:37 2010
New Revision: 1845

Log:
Avoid shadow previous 'register' method definition.

Modified:
    trunk/neo/protocol.py

Modified: trunk/neo/protocol.py
==============================================================================
--- trunk/neo/protocol.py [iso-8859-1] (original)
+++ trunk/neo/protocol.py [iso-8859-1] Tue Feb 23 16:59:37 2010
@@ -1408,7 +1408,7 @@
 # build a "singleton"
 Packets = PacketRegistry()
 
-def register(code):
+def register_error(code):
     def wrapper(registry, message=''):
         return Error(code, message)
     return wrapper
@@ -1421,12 +1421,12 @@
     def __init__(self):
         dict.__init__(self)
 
-    Ack = register(ErrorCodes.ACK)
-    ProtocolError = register(ErrorCodes.PROTOCOL_ERROR)
-    TidNotFound = register(ErrorCodes.TID_NOT_FOUND)
-    OidNotFound = register(ErrorCodes.OID_NOT_FOUND)
-    NotReady = register(ErrorCodes.NOT_READY)
-    Broken = register(ErrorCodes.BROKEN_NODE)
+    Ack = register_error(ErrorCodes.ACK)
+    ProtocolError = register_error(ErrorCodes.PROTOCOL_ERROR)
+    TidNotFound = register_error(ErrorCodes.TID_NOT_FOUND)
+    OidNotFound = register_error(ErrorCodes.OID_NOT_FOUND)
+    NotReady = register_error(ErrorCodes.NOT_READY)
+    Broken = register_error(ErrorCodes.BROKEN_NODE)
 
 Errors = ErrorRegistry()
 





More information about the Neo-report mailing list