Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
2753f348
Commit
2753f348
authored
Nov 17, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename variable
parent
73dcca57
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
topydo/lib/prettyprinters/Colors.py
topydo/lib/prettyprinters/Colors.py
+6
-6
No files found.
topydo/lib/prettyprinters/Colors.py
View file @
2753f348
...
...
@@ -33,7 +33,6 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
def
filter
(
self
,
p_todo_str
,
p_todo
):
""" Applies the colors. """
if
config
().
colors
():
color
=
NEUTRAL_COLOR
colorscheme
=
Colors
()
priority_colors
=
colorscheme
.
get_priority_colors
()
project_color
=
colorscheme
.
get_project_color
()
...
...
@@ -41,8 +40,9 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
metadata_color
=
colorscheme
.
get_metadata_color
()
link_color
=
colorscheme
.
get_link_color
()
priority_color
=
NEUTRAL_COLOR
try
:
color
=
priority_colors
[
p_todo
.
priority
()]
priority_
color
=
priority_colors
[
p_todo
.
priority
()]
except
KeyError
:
pass
...
...
@@ -51,23 +51,23 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
r'\
B(
\+|@)(\
S*
\w)'
,
lambda
m
:
(
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
)
# tags
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
)
# add link_color to any valid URL specified outside of the tag.
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 += NEUTRAL_COLOR
# color by priority
p_todo_str = color + p_todo_str
p_todo_str =
priority_
color + p_todo_str
return p_todo_str
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment