[pitivi/ges] loggable: Fix output coloration



commit 55d4cbead7764d963dacb62aa9a0cd70dc242942
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Thu Apr 19 01:25:13 2012 -0400

    loggable: Fix output coloration

 pitivi/utils/loggable.py |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/pitivi/utils/loggable.py b/pitivi/utils/loggable.py
index 888129c..9fae739 100644
--- a/pitivi/utils/loggable.py
+++ b/pitivi/utils/loggable.py
@@ -21,6 +21,7 @@
 
 import errno
 import sys
+import re
 import os
 import fnmatch
 import time
@@ -642,19 +643,11 @@ def stderrHandler(level, object, category, file, line, message):
 def _preformatLevels(noColorEnvVarName):
     format = '%-5s'
 
-    try:
-        import termcolor
-    except ImportError:
-        # we don't need to catch this if termcolor is in same package as
-        # log.py
-        termcolor = None
-
     if (noColorEnvVarName is not None
-        and termcolor is not None
         and (noColorEnvVarName not in os.environ
              or not os.environ[noColorEnvVarName])):
 
-        t = termcolor.TerminalController()
+        t = TerminalController()
         formatter = lambda level: ''.join((t.BOLD, getattr(t, COLORS[level]),
                             format % (_LEVEL_NAMES[level - 1], ), t.NORMAL))
     else:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]