diff options
author | Florian Bruhin <git@the-compiler.org> | 2014-09-22 20:31:54 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2014-09-22 20:31:54 +0200 |
commit | bd11913a4ae377ebc399fca6a1af4d40e2ca82bc (patch) | |
tree | e6ba7fd3d8ae7869731b09b2a958fb1bcd631258 /scripts/utils.py | |
parent | a7c1f38344fe8d1492fde0f185608b37e9b5ccbd (diff) | |
download | qutebrowser-bd11913a4ae377ebc399fca6a1af4d40e2ca82bc.tar.gz qutebrowser-bd11913a4ae377ebc399fca6a1af4d40e2ca82bc.zip |
Add colorama to scripts.utils
Diffstat (limited to 'scripts/utils.py')
-rw-r--r-- | scripts/utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/utils.py b/scripts/utils.py index 0c66814a1..daa3a7dcc 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -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, |