Backed out changeset 1566b80f6c2b (bug 1026181) since the curses module isn't available
authorEd Morley <emorley@mozilla.com>
Mon, 23 Jun 2014 17:20:02 +0100
changeset 190151 6a1dd10c12c28b0ccbb72710dceb594d312a928e
parent 190150 9d0abd034712f085b91a07788d285ce9cd33d361
child 190152 4fcb817ed3341478116032e8634b5f37a3873600
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs1026181
milestone33.0a1
backs out1566b80f6c2bfe87c71d596e138afbe2b0fa55f4
Backed out changeset 1566b80f6c2b (bug 1026181) since the curses module isn't available
testing/mozbase/mozlog/mozlog/structured/commandline.py
testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
testing/mozbase/mozlog/setup.py
--- a/testing/mozbase/mozlog/mozlog/structured/commandline.py
+++ b/testing/mozbase/mozlog/mozlog/structured/commandline.py
@@ -57,47 +57,37 @@ def add_logging_group(parser):
     else:
         group = parser.add_argument_group(group_name,
                                           group_description)
         for name, (cls, help_str) in log_formatters.iteritems():
             group.add_argument("--log-" + name, action="append", type=log_file,
                                help=help_str)
 
 
-def setup_logging(suite, args, defaults=None):
+def setup_logging(suite, args, defaults):
     """
     Configure a structuredlogger based on command line arguments.
 
     The created structuredlogger will also be set as the default logger, and
     can be retrieved with :py:func:`get_default_logger`.
 
     :param suite: The name of the testsuite being run
     :param args: A dictionary of {argument_name:value} produced from
                  parsing the command line arguments for the application
     :param defaults: A dictionary of {formatter name: output stream} to apply
-                     when there is no logging supplied on the command line. If
-                     this isn't supplied, reasonable defaults are chosen
-                     (coloured mach formatting if stdout is a terminal, or raw
-                     logs otherwise).
+                     when there is no logging supplied on the command line.
 
     :rtype: StructuredLogger
     """
     logger = StructuredLogger(suite)
     prefix = "log_"
     found = False
     found_stdout_logger = False
     if not hasattr(args, 'iteritems'):
         args = vars(args)
-
-    if defaults is None:
-        if sys.__stdout__.isatty():
-            defaults = {"mach_terminal": sys.stdout}
-        else:
-            defaults = {"raw": sys.stdout}
-
     for name, values in args.iteritems():
         if name.startswith(prefix) and values is not None:
             for value in values:
                 found = True
                 if isinstance(value, str):
                     value = log_file(value)
                 if value == sys.stdout:
                     found_stdout_logger = True
--- a/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
+++ b/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
@@ -1,16 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import time
 
-import blessings
-
 import base
 
 
 def format_seconds(total):
     """Format number of seconds to MM:SS.DD form."""
     minutes, seconds = divmod(total, 60)
     return '%2d:%05.2f' % (minutes, seconds)
 
@@ -131,18 +129,16 @@ class MachTerminalFormatter(BaseMachForm
     :param write_interval: bool indicating whether to include the interval since the
                            last message
     :param write_times: bool indicating whether to include the time since the testrun
                         started.
     :param terminal: Terminal object from mach.
     """
     def __init__(self, start_time=None, write_interval=False, write_times=True,
                  terminal=None):
-        if terminal is None:
-            terminal = blessings.Terminal()
         self.terminal = terminal
         BaseMachFormatter.__init__(self,
                                    start_time=start_time,
                                    write_interval=write_interval,
                                    write_times=write_times)
 
     def __call__(self, data):
         s = BaseMachFormatter.__call__(self, data)
--- a/testing/mozbase/mozlog/setup.py
+++ b/testing/mozbase/mozlog/setup.py
@@ -12,17 +12,16 @@ setup(name=PACKAGE_NAME,
       description="Robust log handling specialized for logging in the Mozilla universe",
       long_description="see http://mozbase.readthedocs.org/",
       author='Mozilla Automation and Testing Team',
       author_email='tools@lists.mozilla.org',
       url='https://wiki.mozilla.org/Auto-tools/Projects/Mozbase',
       license='MPL 1.1/GPL 2.0/LGPL 2.1',
       packages=find_packages(),
       zip_safe=False,
-      install_requires=["blessings>=1.3"],
       tests_require=['mozfile'],
       platforms =['Any'],
       classifiers=['Development Status :: 4 - Beta',
                    'Environment :: Console',
                    'Intended Audience :: Developers',
                    'License :: OSI Approved :: Mozilla Public License 1.1 (MPL 1.1)',
                    'Operating System :: OS Independent',
                    'Topic :: Software Development :: Libraries :: Python Modules',