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
42dba297
Commit
42dba297
authored
Sep 27, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add append command.
parent
a2627d36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
AppendCommand.py
AppendCommand.py
+14
-0
Main.py
Main.py
+3
-6
No files found.
AppendCommand.py
0 → 100644
View file @
42dba297
import
Command
from
Utils
import
convert_todo_number
class
AppendCommand
(
Command
.
Command
):
def
__init__
(
self
,
p_args
,
p_todolist
):
super
(
AppendCommand
,
self
).
__init__
(
p_args
,
p_todolist
)
def
execute
(
self
):
number
=
convert_todo_number
(
self
.
argument
(
0
))
text
=
self
.
argument
(
1
)
self
.
todolist
.
append
(
number
,
text
)
return
True
Main.py
View file @
42dba297
...
...
@@ -5,6 +5,7 @@ import re
import
sys
from
AddCommand
import
AddCommand
from
AppendCommand
import
AppendCommand
from
DepCommand
import
DepCommand
import
Config
import
Filter
...
...
@@ -69,12 +70,8 @@ class Application(object): # TODO: rename to CLIApplication
def
append
(
self
):
""" Appends a text to a todo item. """
number
=
convert_todo_number
(
argument
(
2
))
text
=
argument
(
3
)
self
.
todolist
.
append
(
number
,
text
)
self
.
print_todo
(
number
)
command
=
AppendCommand
(
arguments
(),
self
.
todolist
)
command
.
execute
()
def
dep
(
self
):
command
=
DepCommand
(
arguments
(),
self
.
todolist
)
...
...
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