[Zope-Checkins] CVS: Zope2 - dispatcher.py:1.1.2.4
Andreas Jung
andreas@dhcp165.digicool.com
Mon, 12 Mar 2001 10:32:51 -0500
Update of /mnt/cvs-repository/Zope2/lib/python/Testing
In directory yetix:/work/Zope2/Catalog-BTrees-Integration/lib/python/Testing
Modified Files:
Tag: Catalog-BTrees-Integration
dispatcher.py
Log Message:
missing return code in s2s() fixed
--- Updated File dispatcher.py in package Zope2 --
--- dispatcher.py 2001/03/09 19:34:18 1.1.2.3
+++ dispatcher.py 2001/03/12 15:32:49 1.1.2.4
@@ -8,7 +8,7 @@
import os,sys,re,string
-import threading,time,commands,resource
+import threading,time,commands,profile
class Dispatcher:
@@ -23,6 +23,7 @@
self.f_teardown = []
self.lastlog = ""
self.lock = threading.Lock()
+ self.profiling = 0
def setlog(self,fp):
self.fp = fp
@@ -38,6 +39,13 @@
self.fp.write(s + '\n')
self.fp.flush()
self.lastlog=s
+
+
+ def profiling_on():
+ self.profiling = 1
+
+ def profiling_off():
+ self.profiling = 0
def dispatcher(self,name='', *params):
@@ -158,6 +166,7 @@
if n <1024.0: return "%8.3lf Bytes" % n
if n <1024.0*1024.0: return "%8.3lf KB" % (1.0*n/1024.0)
if n <1024.0*1024.0*1024.0: return "%8.3lf MB" % (1.0*n/1024.0/1024.0)
+ else: return n
if __name__=="__main__":