Commit bd604700 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Make sure that filters are not confused by ANSI color codes.

This is done by applying the colors as the last step, so the preceding
filters don't have to worry about it.
parent 1139c19f
......@@ -58,12 +58,16 @@ class View(object):
# since we're using filters, always use PrettyPrinter
printer = PrettyPrinter()
printer.add_filter(PrettyPrinterNumbers(self._todolist))
printer.add_filter(PrettyPrinterColorFilter())
for ppf in p_pp_filters:
printer.add_filter(ppf)
# apply colors at the last step, the ANSI codes may confuse the
# preceding filters.
printer.add_filter(PrettyPrinterColorFilter())
return printer.print_list(self._viewdata)
def __str__(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment