Code Repositories xandikos / 12a7bb3
Fix style. Jelmer Vernooń≥ 5 months ago
2 changed file(s) with 8 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
210210 cal = self.calendar
211211 # TODO(jelmer): return the list of errors to the caller
212212 if cal.is_broken:
213 raise InvalidFileContents(self.content_type, self.content,
213 raise InvalidFileContents(
214 self.content_type, self.content,
214215 "Broken calendar file")
215216 errors = list(validate_calendar(cal, strict=False))
216217 if errors:
217218 raise InvalidFileContents(
218 self.content_type, self.content,
219 ", ".join(errors))
219 self.content_type, self.content,
220 ", ".join(errors))
220221
221222 def normalized(self):
222223 """Return a normalized version of the file."""
229230 self._calendar = Calendar.from_ical(b''.join(self.content))
230231 except ValueError as e:
231232 raise InvalidFileContents(
232 self.content_type, self.content, str(e))
233 self.content_type, self.content, str(e))
233234 return self._calendar
234235
235236 def describe_delta(self, name, previous):
3030 c = b''.join(self.content).strip()
3131 if not c.startswith((b'BEGIN:VCARD\r\n', b'BEGIN:VCARD\n')) or \
3232 not c.endswith(b'\nEND:VCARD'):
33 raise InvalidFileContents(self.content_type, self.content,
34 "Missing header and trailer lines")
33 raise InvalidFileContents(
34 self.content_type, self.content,
35 "Missing header and trailer lines")