diff options
author | pcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2011-02-11 16:17:19 +0000 |
---|---|---|
committer | pcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2011-02-11 16:17:19 +0000 |
commit | 9f99325f381f27c4a6218b980d0f037c2bf641bc (patch) | |
tree | d0448a0468fcd8a4272f2d34eaf1c62f212aeb2a | |
parent | fb909552a11f82a3f0e578e14724259f89f02e45 (diff) | |
download | sos-9f99325f381f27c4a6218b980d0f037c2bf641bc.tar.gz |
[core] textcolor(): do not colorize if not outputting to a tty
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1083 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rwxr-xr-x | sos/sosreport.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py index be29f4d7..5b3155bd 100755 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -209,7 +209,7 @@ def parse_options(opts): def textcolor(text, color, raw=0): """ Terminal text coloring function """ - if GlobalVars.__cmdLineOpts__.nocolors: + if GlobalVars.__cmdLineOpts__.nocolors or not os.isatty(1): return text colors = { "black":"30", "red":"31", "green":"32", "brown":"33", "blue":"34", "purple":"35", "cyan":"36", "lgray":"37", "gray":"1;30", "lred":"1;31", |