[Checkins] SVN: z3c.memhunt.objgraph/trunk/z3c/memhunt/objgraph/browser/views.py renamed some variable names

Daniel Blackburn blackburnd at gmail.com
Mon Dec 6 14:35:27 EST 2010


Log message for revision 118723:
  renamed some variable names

Changed:
  U   z3c.memhunt.objgraph/trunk/z3c/memhunt/objgraph/browser/views.py

-=-
Modified: z3c.memhunt.objgraph/trunk/z3c/memhunt/objgraph/browser/views.py
===================================================================
--- z3c.memhunt.objgraph/trunk/z3c/memhunt/objgraph/browser/views.py	2010-12-06 16:55:25 UTC (rev 118722)
+++ z3c.memhunt.objgraph/trunk/z3c/memhunt/objgraph/browser/views.py	2010-12-06 19:35:26 UTC (rev 118723)
@@ -4,6 +4,7 @@
 from tempfile import NamedTemporaryFile
 
 try:
+    # Make this work for Plone, and zope2
     from Products.Five.browser import BrowserView
     from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 except ImportError:
@@ -32,20 +33,20 @@
         return self.template(self)
         
     def update(self):
-        d = {}
+        res = {}
         # collect all classes
         self.garbage_containing = len(gc.garbage)
         self.garbage_watching = len(gc.get_objects())
         self.total_ref_count = 0
 
-        for m in sys.modules.values():
-            for sym in dir(m):
-                o = getattr (m, sym)
-                if type(o) is types.ClassType:
-                    d[o] = sys.getrefcount (o)
+        for mod in sys.modules.values():
+            for attr in dir(mod):
+                obj = getattr(mod, attr)
+                if type(obj) is types.ClassType:
+                    res[obj] = sys.getrefcount(obj)
 
                     # sort by refcount
-                    pairs = map (lambda x: (repr(x[0]),x[1]), d.items())
+                    pairs = map (lambda x: (repr(x[0]),x[1]), res.items())
                     pairs.sort()
                     pairs.reverse()
 



More information about the checkins mailing list