Add colorama to scripts.utils

This commit is contained in:
Florian Bruhin 2014-09-22 20:31:54 +02:00
parent a7c1f38344
commit bd11913a4a

View File

@ -19,10 +19,22 @@
"""Utility functions for scripts."""
import os
use_color = True
# Import side-effects are an evil thing, but here it's okay so scripts using
# colors work on Windows as well.
try:
import colorama
except ImportError:
if os.name == 'nt':
use_color = False
else:
colorama.init()
fg_colors = {
'black': 30,
'red': 31,