]> code.ossystems Code Review - openembedded-core.git/commitdiff
build: ensure LogTee has a valid name property
authorChris Larson <chris_larson@mentor.com>
Tue, 14 Dec 2010 16:25:58 +0000 (09:25 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 14:46:50 +0000 (14:46 +0000)
(Bitbake rev: 0ebb46e25261cfc85aaef2790cba7c1ec057c306)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/build.py

index 3138fbc166af62e4feda42bdf9ca6c8559d1294c..f511caeb9517b5bd7f65226c75c72166d876a927 100644 (file)
@@ -104,26 +104,24 @@ class TaskInvalid(TaskBase):
 
 
 class LogTee(object):
-    def __init__(self, logger, *files):
-        self.files = files
+    def __init__(self, logger, outfile):
+        self.outfile = outfile
         self.logger = logger
+        self.name = self.outfile.name
 
     def write(self, string):
         self.logger.plain(string)
-        for f in self.files:
-            f.write(string)
+        self.outfile.write(string)
 
     def __enter__(self):
-        for f in self.files:
-            f.__enter__()
+        self.outfile.__enter__()
         return self
 
     def __exit__(self, *excinfo):
-        for f in self.files:
-            f.__exit__(*excinfo)
+        self.outfile.__exit__(*excinfo)
 
     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):