[Zope-Checkins] SVN: Zope/branches/2.12/src/ The Control_Panel/DebugInfo/manage_profile ZMI view fixes were

Ross Patterson me at rpatterson.net
Thu Nov 18 17:29:16 EST 2010


Log message for revision 118470:
  The Control_Panel/DebugInfo/manage_profile ZMI view fixes were
  accumulating successive prints of stats.
  

Changed:
  U   Zope/branches/2.12/src/App/ApplicationManager.py
  U   Zope/branches/2.12/src/ZPublisher/Publish.py

-=-
Modified: Zope/branches/2.12/src/App/ApplicationManager.py
===================================================================
--- Zope/branches/2.12/src/App/ApplicationManager.py	2010-11-18 22:09:03 UTC (rev 118469)
+++ Zope/branches/2.12/src/App/ApplicationManager.py	2010-11-18 22:29:15 UTC (rev 118470)
@@ -19,6 +19,7 @@
 import os
 import sys
 import time
+from cStringIO import StringIO
 
 from AccessControl.requestmethod import requestmethod
 from AccessControl.SecurityManagement import getSecurityManager
@@ -235,8 +236,9 @@
             from copy import copy; stats= copy(stats)
             stats.strip_dirs()
         stats.sort_stats(sort)
+        stats.stream = output = StringIO()
         getattr(stats,'print_%s' % mode)(limit)
-        return stats.stream.getvalue()
+        return output.getvalue()
 
     def manage_getSysPath(self):
         return list(sys.path)

Modified: Zope/branches/2.12/src/ZPublisher/Publish.py
===================================================================
--- Zope/branches/2.12/src/ZPublisher/Publish.py	2010-11-18 22:09:03 UTC (rev 118469)
+++ Zope/branches/2.12/src/ZPublisher/Publish.py	2010-11-18 22:29:15 UTC (rev 118470)
@@ -408,9 +408,7 @@
         result=sys._pr_
         pobj.create_stats()
         if _pstat is None:
-            from cStringIO import StringIO
-            stream = StringIO()
-            _pstat = sys._ps_ = pstats.Stats(pobj, stream=stream)
+            _pstat = sys._ps_ = pstats.Stats(pobj)
         else: _pstat.add(pobj)
     finally:
         _plock.release()



More information about the Zope-Checkins mailing list