Commit 42dba297 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add append command.

parent a2627d36
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
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment