def remove_by_id(self, id, typ): logger.info(f'cmd: remove_by_id -{typ} {id}') self.db.delete_data(id, typ) if typ == 't': Out.info(f"task {id} deleted") elif typ == 'e': Out.info(f"event {id} deleted")
def add_event(self, title, day, timeFromTo, freq): logger.info('cmd: event') args = Dataparser.parse('e', title, day, timeFromTo, freq) self.db.new_event(*args) # tupel to parameters (*) Out.info("event added")
def done(self, id): t = self.db.get_task_by(id) if not t: Out.error(f'no task with id {id} found') return 0 done_time = Dataparser.nearest_deadline(t).strftime('%Y-%m-%d %H:%M') Out.info(f'task {id} done until {done_time}') self.db.set_done(id, done_time)
def add_task(self, title, day, time, freq): logger.info('cmd: task') args = Dataparser.parse('t', title, day, time, freq) self.db.new_task(*args) # tupel to parameters (*) Out.info("task added")