Commit 29cbfcd8 authored by Ali Rıza KESKIN's avatar Ali Rıza KESKIN
Browse files

nocolor.org support

parent 72f3a700
......@@ -204,7 +204,7 @@ class CLI(inary.ui.UI):
return
elif ka['operation'] == "fetching":
if not ctx.get_option("no_color"):
if not (ctx.get_option("no_color") or "NO_COLOR" in os.environ):
complated_background = (
ka['foregroundcolor'] or 'backgroundgreen')
queried_background = (
......
......@@ -58,7 +58,7 @@ all repositories.
self.init(database=True, write=False)
if not (ctx.get_option('no_color')
if not (ctx.get_option('no_color' or "NO_COLOR" in os.environ)
or ctx.config.get_option('uninstalled')):
ctx.ui.info(
_('Installed packages are shown in this color.'),
......
......@@ -57,7 +57,7 @@ def mvprintw(x, y, msg=''):
def noecho(enabled=True):
if not ctx.get_option('no_color'):
if not (ctx.get_option('no_color') or "NO_COLOR" in os.environ):
if enabled:
printw("\x1b[?25l")
else:
......
......@@ -45,7 +45,7 @@ def join_path(a, *p):
def colorize(msg, color):
"""Colorize the given message for console output"""
if ctx.get_option('no_color') or ctx.config.values.general.no_color:
if ctx.get_option('no_color') or ctx.config.values.general.no_color or "NO_COLOR" in os.environ:
return str(msg)
else:
return str(ctx.const.colors[color] + msg + ctx.const.colors['default'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment