when termcolor is missing, fake colored() function can add bold
This commit is contained in:
parent
bbbca2214b
commit
599775b3fb
1 changed files with 5 additions and 2 deletions
|
|
@ -27,8 +27,11 @@ if sys.platform == 'win32':
|
||||||
try:
|
try:
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
except ImportError:
|
except ImportError:
|
||||||
def colored(s, *args, **kwargs):
|
def colored(s, color=None, on_color=None, attrs=None):
|
||||||
return s
|
if attrs is not None and 'bold' in attrs:
|
||||||
|
return '%s%s%s' % (IFormatter.BOLD, s, IFormatter.NC)
|
||||||
|
else:
|
||||||
|
return s
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import tty
|
import tty
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue