Ejemplo n.º 1
0
    def append_to_project(self, index):
        if index == -1:
            return
        project_id = self.ids[index]
        for region in self.view.sel():
            line = self.view.line(region)
            text = self.view.substr(line).strip()
            items = text.split('\n')

            for item in items:
                item = strip(item)
                for titem in self.tlist:
                    if titem.text == item:
                        titem.remove_self_from_parent()
                todoflow.prepend_subtasks(project_id, item)

        todoflow.save(self.tlist)
Ejemplo n.º 2
0
from datetime import datetime, timedelta, time, date
from create_reminder import create_reminder
from todoflow.printers import PlainPrinter
import todoflow


def set_reminders(todolist):
    for item in todolist.filter("@remind"):
        if item.has_tag("@remind"):
            remind_date_str = item.get_tag_param("@remind")
            at = item.get_tag_param("at") if item.has_tag("at") else "23:59"
            date_str = remind_date_str + " " + at
            remind_date = datetime.strptime(date_str, "%Y-%m-%d %H:%M")
            item.remove_tag("remind")
            item.remove_tag("at")
            create_reminder(item.title.text, PlainPrinter().pformat(item.sublist), remind_date)
            item.tag("willremind", param=date_str)
            print "REMINDER:", item.title.text, remind_date


if __name__ == "__main__":
    t = todoflow.all_lists()
    set_reminders(t)
    todoflow.save(t)
Ejemplo n.º 3
0
from todoflow.workflows.Calendar.to_calendar import create_events_for_list
from todoflow.workflows.Reminders.remind import set_reminders

try:
    from tvcal import tvcal
except Exception as e:
    print e
    print "couldn't reach TV Calendar"
from log_to_day_one import log_to_day_one

all_lists = todoflow.all_lists()
inbox_file = open(inbox_path, 'a')
onhold_list = todoflow.from_file(onhold_path)

log_to_day_one(all_lists.deep_copy())
try:
    tvcal(inbox_file)
except:
    pass

create_events_for_list(all_lists)
set_reminders(all_lists)
ul.update_weekly(onhold_list, inbox_file)
ul.update_waiting(onhold_list, inbox_file)

ul.update_daily(all_lists)
ul.update_followups(all_lists)
ul.update_blocked(all_lists)
ul.update_incremental(all_lists)
todoflow.save(all_lists)