From 6e13096fa04d082535f9b2171d503800b8613a7f Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Sat, 12 Apr 2014 16:48:41 +0200 Subject: [PATCH 1/4] Prevent crashes when loading .reg lexer: For some reason when using python2 you get this in get_all_lexers() ('reg', (), ('*.reg',), ('text/x-windows-registry',)) --- colout/colout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colout/colout.py b/colout/colout.py index 8ac771b..79e7503 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -241,7 +241,7 @@ def load_lexers(): try: lexers.append(lexer[1][0]) except IndexError: - logging.warning("cannot load lexer: %s" % lexer[1][0]) + logging.warning("cannot load lexer: %s" % lexer[0]) pass else: logging.debug("loaded lexer %s" % lexer[1][0]) From 6b16d0090398c4e2e98467d1a98c1911a1a5d3de Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Sat, 12 Apr 2014 16:49:00 +0200 Subject: [PATCH 2/4] Use pies --- colout/colout.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/colout/colout.py b/colout/colout.py index 79e7503..960e4cb 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -5,6 +5,9 @@ # Licensed under the GPL version 3 # 2012 (c) nojhan +from __future__ import absolute_import, division, print_function, unicode_literals +from pies.overrides import * + import sys import re import random From 223cf9d4acda712d007b881c0112c9f9f70952f0 Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Sat, 12 Apr 2014 16:49:51 +0200 Subject: [PATCH 3/4] Remove unneeded assert --- colout/colout.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/colout/colout.py b/colout/colout.py index 960e4cb..1479aa8 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -275,9 +275,6 @@ def colorin(text, color="red", style="normal"): >>> colout.colorin("Faites chier la vache", 41, "normal") '\x1b[0;38;5;41mFaites chier la vache\x1b[0m' """ - - assert( type(color) is str ) - global colormap_idx global debug From 823a6fde4c5d5a3704f507002264be438cfc1946 Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Sat, 12 Apr 2014 16:51:27 +0200 Subject: [PATCH 4/4] bin/colout: do not hard-code python version --- bin/colout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 bin/colout diff --git a/bin/colout b/bin/colout old mode 100644 new mode 100755 index 7702d17..ccea6ea --- a/bin/colout +++ b/bin/colout @@ -8,4 +8,4 @@ set -e set -u -python3 -m colout.colout "$@" +python -m colout.colout "$@"