Add debug mode for re.compile

This commit is contained in:
Johann Dreo 2013-06-05 20:08:00 +02:00
commit 5026751c41

View file

@ -444,7 +444,11 @@ def colorup(text, pattern, color="red", style="normal", on_groups=False):
'\x1b[1;34mF\x1b[0m\x1b[3;34maites\x1b[0m \x1b[1;34mC\x1b[0m\x1b[3;34mhier\x1b[0m la Vache'
"""
global colormap_idx
regex = re.compile(pattern) # , re.IGNORECASE)
if not debug:
regex = re.compile(pattern)
else:
regex = re.compile(pattern, re.DEBUG)
# Prepare the colored text.
colored_text = ""