[Zope-Checkins] CVS: Zope3/lib/python/Zope/Testing - dispatcher.py:1.3.90.3
Steve Alexander
steve@cat-box.net
Fri, 10 May 2002 05:48:19 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Testing
In directory cvs.zope.org:/tmp/cvs-serv25323/lib/python/Zope/Testing
Modified Files:
Tag: Zope-3x-branch
dispatcher.py
Log Message:
Converted tabs to spaces, and other minor formatting changes.
Some files had mixed tabs and spaces, and some files used 4 space tabs
and some used 8 space tabs.
I'd really like folks to check in files that use only spaces for
indentation.
=== Zope3/lib/python/Zope/Testing/dispatcher.py 1.3.90.2 => 1.3.90.3 ===
self.f_teardown = []
self.lastlog = ""
- self.lock = threading.Lock()
+ self.lock = threading.Lock()
self.func = func
self.profiling = 0
@@ -75,10 +75,10 @@
mem_watcher.start()
self.start_test = time.time()
- self.name = name
- self.th_data = {}
- self.runtime = {}
- self._threads = []
+ self.name= name
+ self.th_data = {}
+ self.runtime = {}
+ self._threads= []
s2s=self.s2s
@@ -91,8 +91,10 @@
name="TH_%s_%03d" % (func,i) ,args=args,kwargs=kw)
self._threads.append(th)
- for th in self._threads: th.start()
- while threading.activeCount() > 1: time.sleep(1)
+ for th in self._threads:
+ th.start()
+ while threading.activeCount() > 1:
+ time.sleep(1)
self.logn('ID: %s ' % self.name)
self.logn('FUNC: %s ' % self.func)
@@ -127,7 +129,7 @@
del kw['t_func']
ts = time.time()
- apply(t_func,args,kw)
+ apply(t_func,args,kw)
te = time.time()
for func in self.f_teardown: getattr(self,func)()
@@ -137,8 +139,7 @@
def th_setup(self):
""" initalize thread with some environment data """
- env = {'start': time.time()
- }
+ env = {'start': time.time()}
return env
@@ -155,7 +156,8 @@
def getmem(self):
""" try to determine the current memory usage """
- if not sys.platform in ['linux2']: return None
+ if not sys.platform in ['linux2']:
+ return None
cmd = '/bin/ps --no-headers -o pid,vsize --pid %s' % os.getpid()
outp = commands.getoutput(cmd)
pid,vsize = filter(lambda x: x!="" , string.split(outp," ") )
@@ -176,7 +178,8 @@
while running ==1:
self.mem_usage.append( self.getmem() )
time.sleep(1)
- if threading.activeCount() == 2: running = 0
+ if threading.activeCount() == 2:
+ running = 0
def register_startup(self,func):