forked from Ponysearch/Ponysearch
[fix] do not colorize output on dumb terminals
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
ca0889d488
commit
9c581466e1
1 changed files with 2 additions and 1 deletions
|
@ -1,11 +1,12 @@
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
import searx.search
|
import searx.search
|
||||||
import searx.search.processors
|
import searx.search.processors
|
||||||
import searx.search.checker
|
import searx.search.checker
|
||||||
|
|
||||||
|
|
||||||
if sys.stdout.isatty():
|
if sys.stdout.isatty() and os.environ.get('TERM') not in ['dumb', 'unknown']:
|
||||||
RESET_SEQ = "\033[0m"
|
RESET_SEQ = "\033[0m"
|
||||||
COLOR_SEQ = "\033[1;%dm"
|
COLOR_SEQ = "\033[1;%dm"
|
||||||
BOLD_SEQ = "\033[1m"
|
BOLD_SEQ = "\033[1m"
|
||||||
|
|
Loading…
Reference in a new issue