diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-02 16:14:05 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-02 16:14:05 +0100 |
commit | d2e817bd225d6d1711cbd34e8beb664c46020a5b (patch) | |
tree | ed2132fb946ab6c931377298a56e10d4b1557928 | |
parent | changed ws port to avoid conflicts (diff) | |
download | pyload-d2e817bd225d6d1711cbd34e8beb664c46020a5b.tar.xz |
colored log on windows
-rw-r--r-- | pyload/Core.py | 18 | ||||
-rw-r--r-- | pyload/web/bower.json | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/pyload/Core.py b/pyload/Core.py index 2a08b37f7..4a9c51379 100644 --- a/pyload/Core.py +++ b/pyload/Core.py @@ -507,9 +507,10 @@ class Core(object): # file handler formatter fhfmt = "%(asctime)s %(levelname)-8s %(message)s" fh_frm = logging.Formatter(fhfmt, datefmt) + console_frm = fh_frm # console formatter - if self.config['log']['console_color'] and os.name != "nt": + if self.config['log']['console_color']: from lib.colorlog import ColoredFormatter if self.config['log']['color_theme'] == "full": @@ -530,11 +531,18 @@ class Core(object): 'CRITICAL': 'purple', } - console_frm = ColoredFormatter(cfmt, datefmt, clr) - else: - console_frm = fh_frm + color = True + if os.name == "nt": + try: + import colorama + colorama.init() + except: + color = False + print "Install 'colorama' to use the colored log on windows" + + if color: console_frm = ColoredFormatter(cfmt, datefmt, clr) - #: set console formatter + # set console formatter console.setFormatter(console_frm) self.log = logging.getLogger("log") # setable in config diff --git a/pyload/web/bower.json b/pyload/web/bower.json index 4c7e7b1eb..3446dda04 100644 --- a/pyload/web/bower.json +++ b/pyload/web/bower.json @@ -13,7 +13,7 @@ "flot": "~0.8.2", "underscore": "~1.5.0", "backbone": "1.1.0", - "backbone.marionette": "1.4.0", + "backbone.marionette": "1.4.1", "handlebars.js": "1.0.0-rc.3", "jed": "~0.5.4", "select2": "~3.4.5", |