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
04c5669f
Commit
04c5669f
authored
Sep 15, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give caller of tag_value ability to specify a default return value.
parent
787bbeca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
TodoBase.py
TodoBase.py
+4
-4
No files found.
TodoBase.py
View file @
04c5669f
...
...
@@ -26,13 +26,13 @@ class TodoBase(object):
self
.
set_text
(
p_src
)
def
tag_value
(
self
,
p_key
):
def
tag_value
(
self
,
p_key
,
p_default
=
None
):
"""
Returns a tag value associated with p_key. Returns
None
if p_key
does not exist.
Returns a tag value associated with p_key. Returns
p_default
if p_key
does not exist
(which defaults to None)
.
"""
values
=
self
.
tag_values
(
p_key
)
return
values
[
0
]
if
len
(
values
)
else
None
return
values
[
0
]
if
len
(
values
)
else
p_default
def
tag_values
(
self
,
p_key
):
"""
...
...
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