def _prop_from_ref(self, p): if (p == None or p == WrapperNULL): return None d = {} d['value'] = icalproperty_get_value_as_string(p) d['name'] = icalproperty_get_property_name(p) propkind = icalproperty_string_to_kind(d['name']) kind = icalproperty_kind_to_value_kind(propkind) d['value_type'] = icalvalue_kind_to_string(kind) d['ref'] = p #~ print p, Property(ref=p).name() if not self.cached_props.has_key(p): if d['value_type'] == 'DATE-TIME' or d['value_type'] == 'DATE': prop = Time(d, ) elif d['value_type'] == 'PERIOD': prop = Period(d) elif d['value_type'] == 'DURATION': prop = Duration(d) elif d['name'] == 'ATTACH': prop = Attach(d) elif d['name'] == 'ATTENDEE': prop = Attendee(d) elif d['name'] == 'ORGANIZER': prop = Organizer(d) else: prop = Property(ref=p) self.cached_props[p] = prop
def _prop_from_ref(self, p): if (p == None or p == WrapperNULL): return None d_string = icallangbind_property_eval_string(p, ":") d = eval(d_string) d['ref'] = p if not self.cached_props.has_key(p): if d['value_type'] == 'DATE-TIME' or d['value_type'] == 'DATE': prop = Time(d, ) elif d['value_type'] == 'PERIOD': prop = Period(d) elif d['value_type'] == 'DURATION': prop = Duration(d) elif d['name'] == 'ATTACH': prop = Attach(d) elif d['name'] == 'ATTENDEE': prop = Attendee(d) elif d['name'] == 'ORGANIZER': prop = Organizer(d) else: prop = Property(ref=p) self.cached_props[p] = prop
#!/usr/bin/env python