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:
|
||||
from termcolor import colored
|
||||
except ImportError:
|
||||
def colored(s, *args, **kwargs):
|
||||
return s
|
||||
def colored(s, color=None, on_color=None, attrs=None):
|
||||
if attrs is not None and 'bold' in attrs:
|
||||
return '%s%s%s' % (IFormatter.BOLD, s, IFormatter.NC)
|
||||
else:
|
||||
return s
|
||||
|
||||
try:
|
||||
import tty
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue