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
22218f2f
Commit
22218f2f
authored
Oct 12, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce partof: tag as alias for before:
parent
c0d76274
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
AddCommand.py
AddCommand.py
+6
-2
No files found.
AddCommand.py
View file @
22218f2f
""" Provides the AddCommand class that implements the 'add' subcommand. """
from
datetime
import
date
import
re
...
...
@@ -28,7 +30,8 @@ class AddCommand(Command.Command):
* It converts relative dates to absolute ones.
* Automatically inserts a creation date if not present.
* Handles more user-friendly dependencies with before: and after: tags
* Handles more user-friendly dependencies with before:, partof: and
after: tags
"""
def
convert_date
(
p_tag
):
value
=
self
.
todo
.
tag_value
(
p_tag
)
...
...
@@ -47,7 +50,7 @@ class AddCommand(Command.Command):
if
p_tag
==
'after'
:
self
.
todolist
.
add_dependency
(
self
.
todo
.
attributes
[
'number'
],
value
)
elif
p_tag
==
'before'
:
elif
p_tag
==
'before'
or
p_tag
==
'partof'
:
self
.
todolist
.
add_dependency
(
value
,
self
.
todo
.
attributes
[
'number'
])
self
.
todo
.
remove_tag
(
p_tag
,
raw_value
)
...
...
@@ -55,6 +58,7 @@ class AddCommand(Command.Command):
convert_date
(
Config
.
TAG_START
)
convert_date
(
Config
.
TAG_DUE
)
add_dependencies
(
'partof'
)
add_dependencies
(
'before'
)
add_dependencies
(
'after'
)
...
...
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