[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Wed Apr 7 23:42:34 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 61d916e8c839c97304b950f5055e814efecd1cfc
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 16 08:11:58 2009 +0000

    2009-11-16  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Siedel.
    
            Move OutputTee to logging.py.
    
            * Scripts/bugzilla-tool:
            * Scripts/modules/logging.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51013 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 411342f..636dd4d 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,12 @@
+2009-11-16  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Siedel.
+
+        Move OutputTee to logging.py.
+
+        * Scripts/bugzilla-tool:
+        * Scripts/modules/logging.py:
+
 2009-11-15  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/Scripts/bugzilla-tool b/WebKitTools/Scripts/bugzilla-tool
index 3c07a37..6fea61f 100755
--- a/WebKitTools/Scripts/bugzilla-tool
+++ b/WebKitTools/Scripts/bugzilla-tool
@@ -44,7 +44,7 @@ from optparse import OptionParser, IndentedHelpFormatter, SUPPRESS_USAGE, make_o
 from modules.bugzilla import Bugzilla, parse_bug_id
 from modules.changelogs import ChangeLog
 from modules.comments import bug_comment_from_commit_text
-from modules.logging import error, log, tee
+from modules.logging import error, log, tee, OutputTee
 from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
 from modules.buildbot import BuildBot
 from modules.statusbot import StatusBot
@@ -674,42 +674,6 @@ class CheckTreeStatus(Command):
             print "%s : %s" % (status_string.ljust(4), builder['name'])
 
 
-class OutputTee:
-    def __init__(self):
-        self._original_stdout = None
-        self._original_stderr = None
-        self._files_for_output = []
-
-    def add_log(self, path):
-        log_file = self._open_log_file(path)
-        self._files_for_output.append(log_file)
-        self._tee_outputs_to_files(self._files_for_output)
-        return log_file
-
-    def remove_log(self, log_file):
-        self._files_for_output.remove(log_file)
-        self._tee_outputs_to_files(self._files_for_output)
-        log_file.close()
-
-    @staticmethod
-    def _open_log_file(log_path):
-        (log_directory, log_name) = os.path.split(log_path)
-        if log_directory and not os.path.exists(log_directory):
-            os.makedirs(log_directory)
-        return open(log_path, 'a+')
-
-    def _tee_outputs_to_files(self, files):
-        if not self._original_stdout:
-            self._original_stdout = sys.stdout
-            self._original_stderr = sys.stderr
-        if files and len(files):
-            sys.stdout = tee(self._original_stdout, *files)
-            sys.stderr = tee(self._original_stderr, *files)
-        else:
-            sys.stdout = self._original_stdout
-            sys.stderr = self._original_stderr
-
-
 class WorkQueueDelegate:
     def queue_log_path(self):
         raise NotImplementedError, "subclasses must implement"
diff --git a/WebKitTools/Scripts/modules/logging.py b/WebKitTools/Scripts/modules/logging.py
index cbccacf..e8c8be6 100644
--- a/WebKitTools/Scripts/modules/logging.py
+++ b/WebKitTools/Scripts/modules/logging.py
@@ -46,3 +46,38 @@ class tee:
     def write(self, string):
         for file in self.files:
             file.write(string)
+
+class OutputTee:
+    def __init__(self):
+        self._original_stdout = None
+        self._original_stderr = None
+        self._files_for_output = []
+
+    def add_log(self, path):
+        log_file = self._open_log_file(path)
+        self._files_for_output.append(log_file)
+        self._tee_outputs_to_files(self._files_for_output)
+        return log_file
+
+    def remove_log(self, log_file):
+        self._files_for_output.remove(log_file)
+        self._tee_outputs_to_files(self._files_for_output)
+        log_file.close()
+
+    @staticmethod
+    def _open_log_file(log_path):
+        (log_directory, log_name) = os.path.split(log_path)
+        if log_directory and not os.path.exists(log_directory):
+            os.makedirs(log_directory)
+        return open(log_path, 'a+')
+
+    def _tee_outputs_to_files(self, files):
+        if not self._original_stdout:
+            self._original_stdout = sys.stdout
+            self._original_stderr = sys.stderr
+        if files and len(files):
+            sys.stdout = tee(self._original_stdout, *files)
+            sys.stderr = tee(self._original_stderr, *files)
+        else:
+            sys.stdout = self._original_stdout
+            sys.stderr = self._original_stderr

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list