Reset the colours to blank, when we turn color off
authorJames Antill <james@and.org>
Thu, 18 Jun 2009 15:39:29 +0000 (11:39 -0400)
committerJames Antill <james@and.org>
Thu, 18 Jun 2009 15:40:52 +0000 (11:40 -0400)
output.py

index 9456df1..3efccf2 100755 (executable)
--- a/output.py
+++ b/output.py
@@ -141,10 +141,6 @@ class YumTerm:
         self.BG_COLOR = self.__ansi_forced_BG_COLOR
 
     def reinit(self, term_stream=None, color='auto'):
-        if color == 'never':
-            self.__enabled = False
-            return
-
         self.__enabled = True
         if not hasattr(urlgrabber.progress, 'terminal_width_cached'):
             self.columns = 80
@@ -153,7 +149,6 @@ class YumTerm:
         if color == 'always':
             self.__forced_init()
             return
-        assert color == 'auto'
 
         # Output modes:
         self.MODE = {
@@ -188,6 +183,11 @@ class YumTerm:
             'white' : ''
             }
 
+        if color == 'never':
+            self.__enabled = False
+            return
+        assert color == 'auto'
+
         # Curses isn't available on all platforms
         try:
             import curses