MCPcopy Index your code
hub / github.com/pimutils/vdirsyncer / _split_collection_impl

Function _split_collection_impl

vdirsyncer/vobject.py:150–173  ·  view source on GitHub ↗
(item, main, inline, items, ungrouped_items)

Source from the content-addressed store, hash-verified

148
149
150def _split_collection_impl(item, main, inline, items, ungrouped_items):
151 if item.name == 'VTIMEZONE':
152 inline.append(item)
153 elif item.name == 'VCARD':
154 ungrouped_items.append(item)
155 elif item.name in ('VTODO', 'VEVENT', 'VJOURNAL'):
156 uid = item.get('UID', '')
157 wrapper = _Component(main.name, main.props[:], [])
158
159 if uid.strip():
160 wrapper = items.setdefault(uid, wrapper)
161 else:
162 ungrouped_items.append(wrapper)
163
164 wrapper.subcomponents.append(item)
165 elif item.name in ('VCALENDAR', 'VADDRESSBOOK'):
166 if item.name == 'VCALENDAR':
167 del item['METHOD']
168 for subitem in item.subcomponents:
169 _split_collection_impl(subitem, item, inline, items,
170 ungrouped_items)
171 else:
172 raise ValueError('Unknown component: {}'
173 .format(item.name))
174
175
176_default_join_wrappers = {

Callers 1

split_collectionFunction · 0.85

Calls 2

_ComponentClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected