def archive_command( n=-1, p=-1, t=-1 # id of the note to archive # id of the project to archive # id of the task to archive ): """ Archive the note, project or task specified. """ c = conn() if n > 0: Note.archive(c, n) elif p > 0: Project.archive(c, p) elif t > 0: Task.archive(c, t) else: raise Exception()
def complete_command(p=-1, t=-1): # id of the project to mark complete # id of the task to mark complete """ Mark the project or task as completed. """ c = conn() if p > 0: project = Project.get(c, p) project.complete(c) Project.archive(c, project.id) print "Project %s marked as complete!" % p elif t > 0: task = Task.get(c, t) task.complete(c) print "Task %s marked as complete!" % t else: raise Exception()