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
a8648fc5
Commit
a8648fc5
authored
Sep 21, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow multiple after: and before: tags when adding a todo.
parent
a0fafb05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
Main.py
Main.py
+10
-9
No files found.
Main.py
View file @
a8648fc5
...
...
@@ -2,6 +2,7 @@
""" Entry file for the Python todo.txt CLI. """
from
datetime
import
date
import
pdb
import
re
import
sys
...
...
@@ -84,20 +85,20 @@ class Application(object):
p_todo
.
set_creation_date
(
date
.
today
())
pdb
.
set_trace
()
for
tag
in
[
'before'
,
'after'
]:
if
p_todo
.
has_tag
(
tag
):
for
raw_value
in
p_todo
.
tag_values
(
tag
):
try
:
raw_value
=
p_todo
.
tag_value
(
tag
)
value
=
int
(
raw_value
)
except
ValueError
:
continue
if
tag
==
'after'
:
self
.
todolist
.
add_dependency
(
p_todo
.
attributes
[
'number'
],
value
)
elif
tag
==
'before'
:
self
.
todolist
.
add_dependency
(
value
,
p_todo
.
attributes
[
'number'
])
if
tag
==
'after'
:
self
.
todolist
.
add_dependency
(
p_todo
.
attributes
[
'number'
],
value
)
elif
tag
==
'before'
:
self
.
todolist
.
add_dependency
(
value
,
p_todo
.
attributes
[
'number'
])
p_todo
.
remove_tag
(
tag
,
raw_value
)
except
ValueError
:
pass
p_todo
.
remove_tag
(
tag
,
raw_value
)
def
print_todo
(
self
,
p_number
):
""" Prints a single todo item to the standard output. """
...
...
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