def __exportTasksToFile(self): out_file = open("/Users/luigi/Dropbox/todo/td.txt","w+") tasks = Tasks.findAllTasks() if tasks: for task in tasks: taskRecord = str(task['_id']) + " $ " + task['todo'] + "\n" out_file.write(taskRecord) out_file.close()
def do_list(self, line): """ Elenca tutti i task inseriti """ sub_command = line.split(' ') if (len(sub_command[0]) > 0): strSearch = "" if ('+' not in sub_command[0]): strSearch = '+' + sub_command[0] tasks = Tasks.findTaskWithTagname(strSearch) for task in tasks: print "%d) %-100s" % (task['_id'],task['todo']) else: tasks = Tasks.findAllTasks() for task in tasks: print "%d) %-100s %-50s" % (task['_id'],task['todo'], task['tags'])