def load_current_tasks(self): self.mutex.lock() self._tasks = [ TaskWrapper(task) for task in task_pool.load_tasks_period( str(self._start_day_range.start), str( self._start_day_range.end)) ] self.mutex.unlock() return self._tasks
def wrap_tasks(): range = today_range() today = date.today() task_pool.refresh_daily({'cyclic': 1, 'showed': today, 'done': 0}) tasks = task_pool.load_tasks_period(str(range.start), str(range.end)) tasks_obj = [] for task in tasks: task['date'] = today task['datetime'] = datetime(today.year, today.month, today.day, task['datetime'].hour, task['datetime'].minute, task['datetime'].second) task_pool.update_task_date({'id': task['id'], 'date': task['date'], 'datetime': str(task['datetime'])}) tasks_obj.append(TaskWrapper(task)) return tasks_obj
def load_current_tasks(self): self.mutex.lock() self._tasks = [TaskWrapper(task) for task in task_pool.load_tasks_period(str(self._start_day_range.start), str(self._start_day_range.end))] self.mutex.unlock() return self._tasks