[svn r45518] Print out communicate atomically
--HG-- branch : trunk
This commit is contained in:
parent
5f62c21272
commit
f78a355042
|
@ -14,6 +14,7 @@ from py.__.misc.terminal_helper import ansi_print, get_terminal_width
|
||||||
from py.__.test.representation import Presenter
|
from py.__.test.representation import Presenter
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import thread
|
||||||
|
|
||||||
class AbstractReporter(object):
|
class AbstractReporter(object):
|
||||||
def __init__(self, config, hosts):
|
def __init__(self, config, hosts):
|
||||||
|
@ -27,11 +28,14 @@ class AbstractReporter(object):
|
||||||
self.skipped = dict([(host, 0) for host in hosts])
|
self.skipped = dict([(host, 0) for host in hosts])
|
||||||
self.passed = dict([(host, 0) for host in hosts])
|
self.passed = dict([(host, 0) for host in hosts])
|
||||||
self.to_rsync = {}
|
self.to_rsync = {}
|
||||||
|
self.lock = thread.allocate_lock()
|
||||||
|
|
||||||
def get_item_name(self, event, colitem):
|
def get_item_name(self, event, colitem):
|
||||||
return "/".join(colitem.listnames())
|
return "/".join(colitem.listnames())
|
||||||
|
|
||||||
def report(self, what):
|
def report(self, what):
|
||||||
|
try:
|
||||||
|
self.lock.acquire()
|
||||||
repfun = getattr(self, "report_" + what.__class__.__name__,
|
repfun = getattr(self, "report_" + what.__class__.__name__,
|
||||||
self.report_unknown)
|
self.report_unknown)
|
||||||
try:
|
try:
|
||||||
|
@ -44,6 +48,8 @@ class AbstractReporter(object):
|
||||||
for i in excinfo.traceback:
|
for i in excinfo.traceback:
|
||||||
print str(i)[2:-1]
|
print str(i)[2:-1]
|
||||||
print excinfo
|
print excinfo
|
||||||
|
finally:
|
||||||
|
self.lock.release()
|
||||||
|
|
||||||
def report_unknown(self, what):
|
def report_unknown(self, what):
|
||||||
if self.config.option.verbose:
|
if self.config.option.verbose:
|
||||||
|
|
Loading…
Reference in New Issue