build: ensure LogTee has a valid name property
(Bitbake rev: 0ebb46e25261cfc85aaef2790cba7c1ec057c306) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
ea91b1dd87
commit
3d51fd2b7d
|
@ -104,26 +104,24 @@ class TaskInvalid(TaskBase):
|
||||||
|
|
||||||
|
|
||||||
class LogTee(object):
|
class LogTee(object):
|
||||||
def __init__(self, logger, *files):
|
def __init__(self, logger, outfile):
|
||||||
self.files = files
|
self.outfile = outfile
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
|
self.name = self.outfile.name
|
||||||
|
|
||||||
def write(self, string):
|
def write(self, string):
|
||||||
self.logger.plain(string)
|
self.logger.plain(string)
|
||||||
for f in self.files:
|
self.outfile.write(string)
|
||||||
f.write(string)
|
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
for f in self.files:
|
self.outfile.__enter__()
|
||||||
f.__enter__()
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __exit__(self, *excinfo):
|
def __exit__(self, *excinfo):
|
||||||
for f in self.files:
|
self.outfile.__exit__(*excinfo)
|
||||||
f.__exit__(*excinfo)
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<LogTee {0}>'.format(', '.join(repr(f.name) for f in self.files))
|
return '<LogTee {0}>'.format(self.name)
|
||||||
|
|
||||||
|
|
||||||
def exec_func(func, d, dirs = None, logfile = NULL):
|
def exec_func(func, d, dirs = None, logfile = NULL):
|
||||||
|
|
Loading…
Reference in New Issue