Beispiel #1
0
def addTodayTasks(file):
    """Add tasks occuring today from a file to the todo list"""
    rem = todo.getDict(file)
    for k,v in rem.iteritems():
        if verbose: print "%3d: %s" % (k, v)
        re_date = re.compile(r"{([^}]+)} ")
        date = re.search(re_date, v)
        if date:
            isToday = parseREM(date.group(1))
            if isToday:
                task = re.sub(re_date, "", v)
                todo.add(task)
                #if verbose: print "Added: ", task
        else:
            if verbose: print "No date found for ", v
Beispiel #2
0
def addTodayTasks(file):
    """Add tasks occuring today from a file to the todo list"""
    rem = todo.getDict(file)
    for k,v in rem.iteritems():
        if verbose: print "%3d: %s" % (k, v)
        re_date = re.compile(r"{([^}]+)} ")
        date = re.search(re_date, v)
        if date:
            isToday = parseREM(date.group(1))
            if isToday:
                task = re.sub(re_date, "", v)
                todo.add(task)
                #if verbose: print "Added: ", task
        else:
            if verbose: print "No date found for ", v
Beispiel #3
0
def addTodayTasks(file):
    """Add tasks occuring today from a file to the todo list"""
    rem = todo.getDict(file)
    for k,v in rem.iteritems():
        if verbose: print "%3d: %s" % (k, v)
        re_date = re.compile(r"{([^}]+)} ")
        date = re.search(re_date, v)
        if date:
            isToday = parseREM(date.group(1)) # date.group(1) = date in Remind format: Wed, 18 +3, Jan 26 +4
            if isToday:
                task = re.sub(re_date, "", v)
                if taskExists(task):
                    if verbose: print "Exists: " + task
                    continue
                todo.add(task)
        else:
            if verbose: print "No date found for ", v
def addTodayTasks(file):
    """Add tasks occuring today from a file to the todo list"""
    rem = todo.getDict(file)
    for k, v in rem.iteritems():
        if verbose: print "%3d: %s" % (k, v)
        re_date = re.compile(r"{([^}]+)} ")
        date = re.search(re_date, v)
        if date:
            isToday = parseREM(
                date.group(1)
            )  # date.group(1) = date in Remind format: Wed, 18 +3, Jan 26 +4
            if isToday:
                task = re.sub(re_date, "", v)
                if taskExists(task):
                    if verbose: print "Exists: " + task
                    continue
                todo.add(task)
        else:
            if verbose: print "No date found for ", v