Example #1
0
def catch(tasks):
    """iterate over all tasks due before today and ask for new duedate"""
    for i, t in enumerate(tasks):
        if t.due and t.due < datetime.date.today() and t.x is None:
            sched = input('{}\nNew due date (blank for future): '.format(
                t.text))
            if sched == '':
                tasks = unschedule(tasks, i)
            else:
                t.due = utils.code_to_datetime(sched)
    return tasks
Example #2
0
def schedule(tasks, num, string):
    """schedule a task as due a certain date using date string"""
    date = utils.code_to_datetime(string)
    tasks[num].due = date
    return tasks
Example #3
0
def view_until_cli(tasks, string):
    """return list of tasks that are due up until the supplied date"""
    date = utils.code_to_datetime(string)
    return view_until(tasks, date)