[z3-checkins] r22464 - z3/sqlos/trunk/src/sqlos

jinty at codespeak.net jinty at codespeak.net
Fri Jan 20 07:43:19 CET 2006


Author: jinty
Date: Fri Jan 20 07:43:17 2006
New Revision: 22464

Modified:
   z3/sqlos/trunk/src/sqlos/adapter.py
Log:
Add a quick hack to get printDebug to work

Modified: z3/sqlos/trunk/src/sqlos/adapter.py
==============================================================================
--- z3/sqlos/trunk/src/sqlos/adapter.py	(original)
+++ z3/sqlos/trunk/src/sqlos/adapter.py	Fri Jan 20 07:43:17 2006
@@ -81,6 +81,23 @@
             self.releaseConnection(conn)
         return val
 
+    def printDebug(self, conn, s, name, type='query'):
+        # XXX this is a quick hack to get it to work - jinty
+        if name == 'Pool' and self.debug != 'Pool':
+            return
+        if type == 'query':
+            sep = ': '
+        else:
+            sep = '->'
+            s = repr(s)
+        spaces = ' '*(8-len(name))
+        if self.debugThreading:
+            threadName = threading.currentThread().getName()
+            threadName = (':' + threadName + ' '*(8-len(threadName)))
+        else:
+            threadName = ''
+        print '%(threadName)s/%(name)s%(spaces)s%(sep)s %(s)s' % locals()
+
 
 class MySQLAdapter(ConnectionAdapter, _mysql.builder()):
 


More information about the z3-checkins mailing list