[Zodb-checkins] CVS: Zope/lib/python/ZODB - DB.py:1.33

Shane Hathaway shane@digicool.com
Mon, 27 Aug 2001 15:25:20 -0400


Update of /cvs-repository/Zope/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv9785/lib/python/ZODB

Modified Files:
	DB.py 
Log Message:
Got cache_detail and cache_extreme_detail working again and added links
from the debugging information screen.


=== Zope/lib/python/ZODB/DB.py 1.32 => 1.33 ===
     def cacheExtremeDetail(self):
         detail=[]
-        def f(con, detail=detail, rc=sys.getrefcount):
+        conn_no = [0]  # A mutable reference to a counter
+        def f(con, detail=detail, rc=sys.getrefcount, conn_no=conn_no):
+            conn_no[0] = conn_no[0] + 1
+            cn = conn_no[0]
             for oid, ob in con._cache.items():
-                id=oid
+                id=''
                 if hasattr(ob,'__dict__'):
                     d=ob.__dict__
                     if d.has_key('id'):
-                        id="%s (%s)" % (oid, d['id'])
+                        id=d['id']
                     elif d.has_key('__name__'):
-                        id="%s (%s)" % (oid, d['__name__'])
+                        id=d['__name__']
     
                 detail.append({
-                    'oid': id,
+                    'conn_no': cn,
+                    'oid': oid,
+                    'id': id,
                     'klass': "%s.%s" % (ob.__class__.__module__,
                                         ob.__class__.__name__),
                     'rc': rc(ob)-4,
-                    'references': con.references(oid),
+                    'state': ob._p_changed,
+                    #'references': con.references(oid),
                     })
 
         self._connectionMap(f)