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
722df420
Commit
722df420
authored
Jun 09, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to unset priority by passing priority = None
parent
04e200e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
TodoBase.py
TodoBase.py
+8
-4
No files found.
TodoBase.py
View file @
722df420
...
@@ -102,12 +102,16 @@ class TodoBase(object):
...
@@ -102,12 +102,16 @@ class TodoBase(object):
def set_priority(self, p_priority):
def set_priority(self, p_priority):
"""
"""
Sets the priority of the todo. Must be a single capital letter [A-Z].
Sets the priority of the todo. Must be a single capital letter [A-Z],
Priority remains unchanged when invalid priority is given.
or None to unset the priority.
Priority remains unchanged when an invalid priority is given.
"""
"""
if re.match('
^
[
A
-
Z
]
$
', p_priority):
if p_priority == None or re.match('
^
[
A
-
Z
]
$
', p_priority):
self.fields['
priority
'] = p_priority
self.fields['
priority
'] = p_priority
self.src = re.sub(r'
^
(
\
([
A
-
Z
]
\
)
)
?
', '
(
' + p_priority + '
)
', self.src)
priority_str = '' if p_priority == None else '
(
' + p_priority + '
)
'
self.src = re.sub(r'
^
(
\
([
A
-
Z
]
\
)
)
?
', priority_str, self.src)
def priority(self):
def priority(self):
"""
"""
...
...
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