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
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
def add_helper(self, args): Namespace = namedtuple("Namespace", args) reminder = todo.Reminder(**args) todo.add(Namespace(**args)) return reminder
import sys import todo if len(sys.argv) >= 3: [_, subcommand, arg] = sys.argv if subcommand == "add": todo.add(arg) elif subcommand == "complete": todo.complete(arg) else: todo.list()