def run(self, edit): self.tlist = todoflow.all_lists() self.projects = [] self.ids = [] for project in self.tlist.filter('type = "project"'): text = '\t' * project.indent_level + project.text self.projects.append(text) self.ids.append(project._id) self.view.window().show_quick_panel(self.projects, self.append_to_project)
if due: print titleize(title, title_color, white) for item in due: param = item.get_tag_param(tag) due_date = datetime.strptime(param, '%Y-%m-%d').date() days = (due_date - date.today()).days days_str = str(days).zfill(2) color = white if item.has_tag('blocked'): color = gray elif days <= 2: color = highlight_color elif days <= 7: color = yellow text = enclose_tags(item.text, blue, defc) dues.append((white + days_str + defc + ' ' + text + defc, color)) for d, c in sorted(dues): print c + d t = todoflow.all_lists() print '\n' * 50 print_due(t) print_dates(t) query_today = '@working and not @done' print_query(t, 'WORKING', query_today, high_green, white) query_next = '@next and not @done and not @working' print_query(t, 'NEXT', query_next, high_blue, white)
import todoflow from todoflow.printers import PythonistaPrinter import sys q = ' '.join(sys.argv[1:]) q = todoflow.expand_query(q) print q t = todoflow.all_lists().filter(q) PythonistaPrinter().pprint(t)