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

Method parse

vdirsyncer/cli/config.py:118–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

116 raise ValueError('Unknown section type.')
117
118 def parse(self):
119 for section in self._parser.sections():
120 if ' ' in section:
121 section_type, name = section.split(' ', 1)
122 else:
123 section_type = name = section
124
125 try:
126 self._parse_section(
127 section_type, name,
128 dict(_parse_options(self._parser.items(section),
129 section=section))
130 )
131 except ValueError as e:
132 raise exceptions.UserError(
133 'Section "{}": {}'.format(section, str(e)))
134
135 _validate_general_section(self._general)
136 if getattr(self._file, 'name', None):
137 self._general['status_path'] = os.path.join(
138 os.path.dirname(self._file.name),
139 expand_path(self._general['status_path'])
140 )
141
142 return self._general, self._pairs, self._storages
143
144
145def _parse_options(items, section=None):

Callers 1

from_fileobjectMethod · 0.45

Calls 5

_parse_sectionMethod · 0.95
_parse_optionsFunction · 0.85
expand_pathFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected