mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
parent
d63b63f7f9
commit
c739bbfcac
1 changed files with 16 additions and 12 deletions
|
|
@ -236,7 +236,8 @@ class _Component(object):
|
|||
|
||||
stack = []
|
||||
rv = []
|
||||
for line in lines:
|
||||
try:
|
||||
for i, line in enumerate(lines):
|
||||
if line.startswith(u'BEGIN:'):
|
||||
c_name = line[len(u'BEGIN:'):].strip().upper()
|
||||
stack.append(cls(c_name, [], []))
|
||||
|
|
@ -249,6 +250,9 @@ class _Component(object):
|
|||
else:
|
||||
if line.strip():
|
||||
stack[-1].props.append(line)
|
||||
except IndexError:
|
||||
raise ValueError('Parsing error at line {}. Check the debug log '
|
||||
'for more information.'.format(i + 1))
|
||||
|
||||
if multiple:
|
||||
return rv
|
||||
|
|
|
|||
Loading…
Reference in a new issue