def fill_task(cls, todo: iCalendar, task: Task, namespace: str): nmspc = {'namespace': namespace} with DisabledSyncCtx(task): for field in cls.fields: field.set_gtg(todo, task, **nmspc) task.set_attribute("url", str(todo.url), **nmspc) task.set_attribute("calendar_url", str(todo.parent.url), **nmspc) task.set_attribute("calendar_name", todo.parent.name, **nmspc) if not CATEGORIES.has_calendar_tag(task, todo.parent): task.add_tag(CATEGORIES.get_calendar_tag(todo.parent)) return task
def write_gtg(self, task: Task, value, namespace: str = None): task.set_attribute(self.dav_name, value, namespace=namespace)