Commit 2753f348 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Rename variable

parent 73dcca57
...@@ -33,7 +33,6 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter): ...@@ -33,7 +33,6 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
def filter(self, p_todo_str, p_todo): def filter(self, p_todo_str, p_todo):
""" Applies the colors. """ """ Applies the colors. """
if config().colors(): if config().colors():
color = NEUTRAL_COLOR
colorscheme = Colors() colorscheme = Colors()
priority_colors = colorscheme.get_priority_colors() priority_colors = colorscheme.get_priority_colors()
project_color = colorscheme.get_project_color() project_color = colorscheme.get_project_color()
...@@ -41,8 +40,9 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter): ...@@ -41,8 +40,9 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
metadata_color = colorscheme.get_metadata_color() metadata_color = colorscheme.get_metadata_color()
link_color = colorscheme.get_link_color() link_color = colorscheme.get_link_color()
priority_color = NEUTRAL_COLOR
try: try:
color = priority_colors[p_todo.priority()] priority_color = priority_colors[p_todo.priority()]
except KeyError: except KeyError:
pass pass
...@@ -51,23 +51,23 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter): ...@@ -51,23 +51,23 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
r'\B(\+|@)(\S*\w)', r'\B(\+|@)(\S*\w)',
lambda m: ( lambda m: (
context_color if m.group(0)[0] == "@" context_color if m.group(0)[0] == "@"
else project_color) + m.group(0) + color, else project_color) + m.group(0) + priority_color,
p_todo_str) p_todo_str)
# tags # tags
p_todo_str = re.sub(r'\b\S+:[^/\s]\S*\b', p_todo_str = re.sub(r'\b\S+:[^/\s]\S*\b',
metadata_color + r'\g<0>' + color, metadata_color + r'\g<0>' + priority_color,
p_todo_str) p_todo_str)
# add link_color to any valid URL specified outside of the tag. # add link_color to any valid URL specified outside of the tag.
p_todo_str = re.sub(r'(^|\s)(\w+:){1}(//\S+)', p_todo_str = re.sub(r'(^|\s)(\w+:){1}(//\S+)',
r'\1' + link_color + r'\2\3' + color, r'\1' + link_color + r'\2\3' + priority_color,
p_todo_str) p_todo_str)
p_todo_str += NEUTRAL_COLOR p_todo_str += NEUTRAL_COLOR
# color by priority # color by priority
p_todo_str = color + p_todo_str p_todo_str = priority_color + p_todo_str
return p_todo_str return p_todo_str
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