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
fae7585e
Commit
fae7585e
authored
Jun 09, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename class to TodoBase.
parent
b8a4f535
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
TodoBase.py
TodoBase.py
+9
-3
TodoFile.py
TodoFile.py
+2
-2
No files found.
Todo.py
→
Todo
Base
.py
View file @
fae7585e
...
...
@@ -6,12 +6,16 @@ import re
import
TodoParser
class
Todo
(
object
):
class
Todo
Base
(
object
):
"""
This class represents a single todo item in a todo.txt file. It maintains
an internal data dictionary of various attributes, but also keeps the plain
text format in shape such that it can be printed back to a file with as few
distortions as possible (no re-shuffling of attributes).
This is a base class, but supports enough to process any item in a todo.txt
file. Derived classes add some interpretation to the tags that may appear
in a todo item.
"""
src
=
None
...
...
@@ -30,8 +34,10 @@ class Todo(object):
return
values
[
0
]
if
len
(
values
)
else
None
def
tag_values
(
self
,
p_key
):
""" Returns a list of all tag values associated with p_key. Returns
empty list if p_key does not exist. """
"""
Returns a list of all tag values associated with p_key. Returns
empty list if p_key does not exist.
"""
tags
=
self
.
fields
[
'tags'
]
matches
=
[
tag
[
1
]
for
tag
in
tags
if
tag
[
0
]
==
p_key
]
...
...
TodoFile.py
View file @
fae7585e
...
...
@@ -2,7 +2,7 @@
This module deals with todo.txt files.
"""
import
Todo
import
Todo
Base
class
TodoFile
(
object
):
"""
...
...
@@ -21,7 +21,7 @@ class TodoFile(object):
todofile
=
open
(
self
.
path
,
'r'
)
for
line
in
todofile
:
todos
.
append
(
Todo
.
Todo
(
line
))
todos
.
append
(
Todo
Base
.
TodoBase
(
line
))
todofile
.
close
()
return
todos
...
...
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