[yum-commits] Branch 'yum-3_2_X' - 4 commits - cli.py docs/yum.8 docs/yum.conf.5 output.py yum/config.py

James Antill james at osuosl.org
Fri Nov 21 15:13:04 UTC 2008


 cli.py          |    2 ++
 docs/yum.8      |    5 +++++
 docs/yum.conf.5 |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 output.py       |    2 ++
 yum/config.py   |    7 +++++--
 5 files changed, 63 insertions(+), 2 deletions(-)

New commits:
commit eac42df07f91bdce3e65633d9b18d9aa61877bd8
Author: James Antill <james at and.org>
Date:   Fri Nov 21 09:41:38 2008 -0500

    Fix the color config. option to work the same as the --color cmd line opt.

diff --git a/cli.py b/cli.py
index e13d48d..c0fc920 100644
--- a/cli.py
+++ b/cli.py
@@ -1114,7 +1114,9 @@ class YumOptionParser(OptionParser):
                     self.base.term.reinit(color=self.base.conf.color)
             else:
                 _remap = {'tty' : 'auto', 'if-tty' : 'auto',
+                          '1' : 'always', 'true' : 'always',
                           'yes' : 'always', 'on' : 'always',
+                          '0' : 'always', 'false' : 'always',
                           'no' : 'never', 'off' : 'never'}
                 opts.color = _remap.get(opts.color, opts.color)
                 if opts.color != 'auto':
diff --git a/yum/config.py b/yum/config.py
index 700b49a..ffd70b3 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -670,8 +670,11 @@ class YumConf(StartupConf):
     bugtracker_url = Option('http://yum.baseurl.org/report')
 
     color = SelectionOption('auto', ('auto', 'never', 'always'),
-                            mapper={'on' : 'always',
-                                    'off' : 'nevern'})
+                            mapper={'on' : 'always', 'yes' : 'always',
+                                    '1' : 'always', 'true' : 'always',
+                                    'off' : 'never', 'no' : 'never',
+                                    '0' : 'never', 'false' : 'never',
+                                    'tty' : 'auto', 'if-tty' : 'auto'})
     color_list_installed_older = Option('bold')
     color_list_installed_newer = Option('bold,yellow')
     color_list_installed_extra = Option('bold,red')
commit 71d1ee2ce8071d3605d2b8ab903a509e3125988c
Author: James Antill <james at and.org>
Date:   Fri Nov 21 09:40:12 2008 -0500

    Add documentation for all the color* config. options

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index 8171455..901f6b4 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -309,6 +309,55 @@ if it is available. Best means install the best arch for this platform, only.
 Url where bugs should be filed for yum. Configurable for local versions or distro-specific
 bugtrackers.
 
+.IP \fBcolor \fR
+Display colorized output automatically, depending on the output terminal,
+always (using ANSI codes) or never.
+Command-line option: \fB\-\-color\fP
+
+.IP \fBcolor_list_installed_older \fR
+The colorization/highlighting for pacakges in list/info installed which are
+older than the latest available package with the same name and arch.
+Default is `bold'.
+Possible values are a comma seperated list containing: bold, blink, dim,
+reverse, underline, fg:black, fg:red, fg:green, fg:yellow, fg:blue, fg:magenta,
+fg:cyan, fg:white, bg:black, bg:red, bg:green, bg:yellow, bg:blue, bg:magenta,
+bg:cyan, bg:white.
+
+.IP \fBcolor_list_installed_newer \fR
+The colorization/highlighting for pacakges in list/info installed which are
+newer than the latest available package with the same name and arch.
+Default is `bold,yellow'.
+See color_list_installed_older for possible values.
+
+.IP \fBcolor_list_installed_extra \fR
+The colorization/highlighting for pacakges in list/info installed which has
+no available package with the same name and arch.
+Default is `bold,red'.
+See color_list_installed_older for possible values.
+
+.IP \fBcolor_list_available_upgrade \fR
+The colorization/highlighting for pacakges in list/info available which is
+an upgrade for the latest installed package with the same name and arch.
+Default is `bold,blue'.
+See color_list_installed_older for possible values.
+
+.IP \fBcolor_list_available_downgrade \fR
+The colorization/highlighting for pacakges in list/info available which is
+a downgrade for the latest installed package with the same name and arch.
+Default is `dim,cyan'.
+See color_list_installed_older for possible values.
+
+.IP \fBcolor_list_available_install \fR
+The colorization/highlighting for pacakges in list/info available which has
+no installed package with the same name and arch.
+Default is `normal'.
+See color_list_installed_older for possible values.
+
+.IP \fBcolor_search_match \fR
+The colorization/highlighting for text matches in search.
+Default is `bold'.
+See color_list_installed_older for possible values.
+
 .SH "[repository] OPTIONS"
 .LP 
 The repository section(s) take the following form:
commit 73d7c2561b7b3758d1afde8f21b55a7e6ae3f361
Author: James Antill <james at and.org>
Date:   Fri Nov 21 09:39:49 2008 -0500

    Add documentation for the --color option

diff --git a/docs/yum.8 b/docs/yum.8
index 4ebd19d..641899d 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -262,6 +262,11 @@ Configuration Option: \fBobsoletes\fP
 Exclude a specific package by name or glob from updates on all repositories.
 Configuration Option: \fBexclude\fP
 .br
+.IP "\fB\-\-color=[always|auto|never]\fP"
+Display colorized output automatically, depending on the output terminal,
+always (using ANSI codes) or never.
+Configuration Option: \fBcolor\fP
+.br
 .IP "\fB\-\-disableexcludes=[all|main|repoid]\fP"
 Disable the excludes defined in your config files. Takes one of three options:
 .br
commit e69f206df701a37716a48ea04cbc1c08f1f0c95c
Author: James Antill <james at and.org>
Date:   Fri Nov 21 09:39:32 2008 -0500

    Minor opt. for no highlighting

diff --git a/output.py b/output.py
index 81b22ca..4f7a6cf 100755
--- a/output.py
+++ b/output.py
@@ -323,6 +323,8 @@ class YumOutput:
             pass
         elif not isinstance(highlight, basestring) or highlight == 'bold':
             hibeg = self.term.MODE['bold']
+        elif highlight == 'normal':
+            pass # Minor opt.
         else:
             # Turn a string into a specific output: colour, bold, etc.
             for high in highlight.replace(',', ' ').split():


More information about the Yum-commits mailing list