validate:tools: Add an option to desativate ANSI colors

And enhance some debugging output
This commit is contained in:
Thibault Saunier 2014-01-10 10:27:25 +01:00
parent eae7e94f44
commit 8697dd3da4
3 changed files with 10 additions and 2 deletions

View file

@ -313,7 +313,8 @@ class _TestsLauncher(Loggable):
if tester.init() is True:
self.testers.append(tester)
else:
self.warning("Can not init tester: %s", tester.name)
self.warning("Can not init tester: %s -- PATH is %s"
% (tester.name, os.environ["PATH"]))
def add_options(self, parser):
for tester in self.testers:

View file

@ -17,6 +17,7 @@
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
import os
import utils
import urlparse
import loggable
from optparse import OptionParser
@ -67,6 +68,9 @@ def main():
default=None,
help="Set the path to which projects should be"
" renderd")
parser.add_option("-n", "--no-color", dest="no_color",
action="store_true", default=False,
help="Set it to output no colored text in the terminal")
loggable.init("GST_VALIDATE_LAUNCHER_DEBUG", True, False)
tests_launcher = _TestsLauncher()
@ -78,6 +82,9 @@ def main():
options.dest = os.path.join(options.logsdir, "rendered")
if urlparse.urlparse(options.dest).scheme == "":
options.dest = path2url(options.dest)
if options.no_color:
utils.desactivate_colors()
tests_launcher.set_settings(options, args)
if options.list_tests:

View file

@ -48,7 +48,7 @@ class Colors(object):
ENDC = '\033[0m'
def desactivate_colors(self):
def desactivate_colors():
Colors.HEADER = ''
Colors.OKBLUE = ''
Colors.OKGREEN = ''