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
391a7283
Commit
391a7283
authored
Jun 12, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write date objects instead of strings with a date to todo fields.
parent
a72ffb97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
TodoParser.py
TodoParser.py
+13
-3
No files found.
TodoParser.py
View file @
391a7283
...
...
@@ -5,6 +5,8 @@ todo.txt file.
import
re
import
Utils
def
parse_line
(
p_string
):
"""
Parses a single line as can be encountered in a todo.txt file.
...
...
@@ -44,12 +46,20 @@ def parse_line(p_string):
if completed_head:
result['
completed
'] = True
result['
completionDate
'] = completed_head.group('
completionDate
')
result['
creationDate
'] = completed_head.group('
creationDate
')
completion_date = completed_head.group('
completionDate
')
result['
completionDate
'] = Utils.date_string_to_date(completion_date)
creation_date = completed_head.group('
creationDate
')
result['
creationDate
'] = Utils.date_string_to_date(creation_date)
rest = completed_head.group('
rest
')
elif normal_head:
result['
priority
'] = normal_head.group('
priority
')
result['
creationDate
'] = normal_head.group('
creationDate
')
creation_date = normal_head.group('
creationDate
')
result['
creationDate
'] = Utils.date_string_to_date(creation_date)
rest = normal_head.group('
rest
')
for word in rest.split():
...
...
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