def __unicode__(self): if self.url_raw is None: self.url_raw = self.url_parsed.geturl() if isinstance(self.url_raw, str): return to_unicode(self.url_raw) else: return to_unicode(str(self.url_raw))
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(to_unicode(self._data)) return self
def __init__(self, name=None, value=None): self.children = [] self.attributes = {} value = to_unicode(value) self.value = None if name is not None: self.attributes['name'] = name if value is not None: self.value = value
def _set_data(self, data): if type(data).__module__.startswith("icalendar"): self._data = data self._instance = data else: self._data = vcal.fix(data) self._instance = icalendar.Calendar.from_ical( to_unicode(self._data)) return self
def _get_icalendar_instance(self): import icalendar if not self._icalendar_instance: self.icalendar_instance = icalendar.Calendar.from_ical( to_unicode(self.data)) return self._icalendar_instance
def _get_vobject_instance(self): if not self._vobject_instance: self._set_vobject_instance( vobject.readOne(to_unicode(self._get_data()))) return self._vobject_instance
def _get_vobject_instance(self): if not self._vobject_instance and self._data: self._vobject_instance = vobject.readOne(to_unicode(self._data)) return self._vobject_instance
def _set_data(self, data): self._data = vcal.fix(data) self._instance = vobject.readOne(io.StringIO(to_unicode(self._data))) return self
def __unicode__(self): if self.url_raw is None: self.url_raw = self.url_parsed.geturl() return to_unicode(self.url_raw)