[Zodb-checkins] SVN: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/ Rename the order and hook arguments to __order and __argument

Julien Anguenot ja at nuxeo.com
Mon Aug 8 18:14:40 EDT 2005


Log message for revision 37801:
  Rename the order and hook arguments to __order and __argument

Changed:
  U   ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/_transaction.py
  U   ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/interfaces.py

-=-
Modified: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/_transaction.py
===================================================================
--- ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/_transaction.py	2005-08-08 21:55:26 UTC (rev 37800)
+++ ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/_transaction.py	2005-08-08 22:14:40 UTC (rev 37801)
@@ -415,19 +415,19 @@
         # backward compatibility. As well, those are internals
         return iter([x[2:5] for x in self._before_commit])
 
-    def beforeCommitHookOrdered(self, hook, order, *args, **kws):
-        if not isinstance(order, IntType):
+    def beforeCommitHookOrdered(self, __hook, __order, *args, **kws):
+        if not isinstance(__order, IntType):
             raise ValueError("An integer value is required "
                              "for the order argument")
         # `index` goes up by 1 on each append.  Then no two tuples can
         # compare equal, and indeed no more than the `order` and
         # `index` fields ever get compared when the tuples are compared
         # (because no two `index` fields are equal).
-        index = len([x[1] for x in self._before_commit if x[1] == order])
-        bisect.insort(self._before_commit, (order, index, hook, args, kws))
+        index = len([x[1] for x in self._before_commit if x[1] == __order])
+        bisect.insort(self._before_commit, (__order, index, __hook, args, kws))
 
-    def beforeCommitHook(self, hook, *args, **kws):
-        self.beforeCommitHookOrdered(hook, 0, *args, **kws)
+    def beforeCommitHook(self, __hook, *args, **kws):
+        self.beforeCommitHookOrdered(__hook, 0, *args, **kws)
 
     def _callBeforeCommitHooks(self):
         # Call all hooks registered, allowing further registrations

Modified: ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/interfaces.py
===================================================================
--- ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/interfaces.py	2005-08-08 21:55:26 UTC (rev 37800)
+++ ZODB/branches/anguenot-ordering-beforecommitsubscribers/src/transaction/interfaces.py	2005-08-08 22:14:40 UTC (rev 37801)
@@ -167,7 +167,7 @@
         raise an exception, or remove `<name, value>` pairs).
         """
 
-    def beforeCommitHook(hook, *args, **kws):
+    def beforeCommitHook(__hook, *args, **kws):
         """Register a hook to call before the transaction is committed.
 
         The specified hook function will be called after the transaction's
@@ -192,7 +192,7 @@
         instead.
         """
 
-    def beforeCommitHookOrdered(hook, order, *args, **kws):
+    def beforeCommitHookOrdered(__hook, __order, *args, **kws):
         """Register a hook to call before the transaction is committed.
 
         The specified hook function will be called after the transaction's



More information about the Zodb-checkins mailing list