MCPcopy
hub / github.com/pimutils/vdirsyncer / with_uid

Method with_uid

vdirsyncer/vobject.py:44–56  ·  view source on GitHub ↗
(self, new_uid)

Source from the content-addressed store, hash-verified

42 self._raw = raw
43
44 def with_uid(self, new_uid):
45 parsed = _Component.parse(self.raw)
46 stack = [parsed]
47 while stack:
48 component = stack.pop()
49 stack.extend(component.subcomponents)
50
51 if component.name in ('VEVENT', 'VTODO', 'VJOURNAL', 'VCARD'):
52 del component['UID']
53 if new_uid:
54 component['UID'] = new_uid
55
56 return Item('\r\n'.join(parsed.dump_lines()))
57
58 @cached_property
59 def raw(self):

Callers 4

listMethod · 0.95
repair_itemFunction · 0.80
innerFunction · 0.80
test_replace_uidFunction · 0.80

Calls 4

ItemClass · 0.85
joinMethod · 0.80
dump_linesMethod · 0.80
parseMethod · 0.45

Tested by 2

innerFunction · 0.64
test_replace_uidFunction · 0.64