def run(self): if len(self.caller.options.args) <= 1: # TODO: should raise an error and let the caller display the error and usage print "Error: must supply a title" print get_help("view"); return task = yabt.models.TaskFactory().find(self.caller.options.args[1]) print task;
def run(self): if len(self.caller.options.args) <= 1: print "Error: must supply a title" print get_help("status") return task = yabt.models.TaskFactory().find(self.caller.options.args[1]) if len(self.caller.options.args) == 3: task.status = self.caller.options.args[2] task.save() print task.subject + " status: " + task.status
def run(self): if len(self.caller.options.args) <= 1: print "Error: must supply a title" print get_help("edit") return task = yabt.models.TaskFactory().find(self.caller.options.args[1]) if os.getenv("EDITOR") is not None: editor = os.getenv("EDITOR") else: editor = "vi" subprocess.call([editor, os.path.join(os.getcwd(), ".yabt", "tickets", task.id)])
def run(self): if len(self.caller.options.args) <= 1: print get_help('add') sys.exit(1) else: subject = self.caller.options.args[1] task = yabt.models.Task() task.subject = subject task.creator = "Travis Swicegood <*****@*****.**>" task.save() # refactor generation of index and path index = yabt.models.Index(os.path.join(os.getcwd(), ".yabt", "index")) index.add_task(task) index.save()
def run(self): try : task_name = self.caller.options.args[1] task = yabt.models.TaskFactory().find(task_name) if task is None: print "Unable to find task \"%s\"" % (task_name) sys.exit(1) task.remove() # refactor generation of index and path index = yabt.models.Index(os.path.join(os.getcwd(), ".yabt", "index")) index.remove_task(task) index.save() except IndexError: print "Error: must provide a task to remove" print get_help('remove') sys.exit(1)