def _set_data(self, data): if type(data).__module__.startswith("vobject"): self._data = data self._instance = data else: self._data = vcal.fix(data) self._instance = vobject.readOne(self._data) return self
async def load(self): """ Load the object from the caldav server. """ r = await self.client.request(self.url) if r.status >= 400 and r.status < 500: raise error.NotFoundError(errmsg(r)) elif r.status >= 500: raise error.ServerError(errmsg(r)) self.data = vcal.fix(r.raw) return self