mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 14:06:14 +02:00
Only install colorama on windows
This commit is contained in:
parent
777eb38852
commit
3f9d9bf84f
2 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,8 @@ import keyring
|
|||
import pytz
|
||||
try: import simplejson as json
|
||||
except ImportError: import json
|
||||
if "win32" in sys.platform:
|
||||
import colorama
|
||||
import re
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
@ -141,5 +143,7 @@ def get_text_from_editor(config, template=""):
|
|||
|
||||
def colorize(string):
|
||||
"""Returns the string wrapped in cyan ANSI escape"""
|
||||
if "win32" in sys.platform:
|
||||
return colorama.Fore.CYAN + string + colorama.Fore.RESET
|
||||
return u"\033[36m{}\033[39m".format(string)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue