[CalendarServer-changes] [15004] twext/trunk/twext/enterprise/adbapi2.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 27 11:26:09 PDT 2015


Revision: 15004
          http://trac.calendarserver.org//changeset/15004
Author:   cdaboo at apple.com
Date:     2015-07-27 11:26:09 -0700 (Mon, 27 Jul 2015)
Log Message:
-----------
Include txn labels in __repr__'s to aid debugging problems.

Modified Paths:
--------------
    twext/trunk/twext/enterprise/adbapi2.py

Modified: twext/trunk/twext/enterprise/adbapi2.py
===================================================================
--- twext/trunk/twext/enterprise/adbapi2.py	2015-07-27 18:18:25 UTC (rev 15003)
+++ twext/trunk/twext/enterprise/adbapi2.py	2015-07-27 18:26:09 UTC (rev 15004)
@@ -164,6 +164,10 @@
         self._label = label
 
 
+    def __repr__(self):
+        return "_ConnectedTxn({})".format(self._label)
+
+
     @_forward
     def paramstyle(self):
         """
@@ -425,6 +429,10 @@
         self._label = label
 
 
+    def __repr__(self):
+        return "_NoTxn({})".format(self._label)
+
+
     def _everything(self, *a, **kw):
         """
         Everything fails with a L{ConnectionError}.
@@ -459,6 +467,10 @@
         self._label = label
 
 
+    def __repr__(self):
+        return "_WaitingTxn({})".format(self._label)
+
+
     def _enspool(self, cmd, a=(), kw={}):
         d = Deferred()
         self._spool.append((d, cmd, a, kw))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150727/8cef3045/attachment.html>


More information about the calendarserver-changes mailing list