Merge pull request #57 from bbernhard/parsing_fix

be more tolerant when parsing libraries
This commit is contained in:
Salvador E. Tropea 2021-03-12 21:22:41 -03:00 committed by GitHub
commit fa002356d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ class LibLineReader(LineReader):
def get_line(self):
res = self.f.readline()
while res and res[0] == '#':
if res.startswith('#End Library'):
if res.startswith('#End Library') or res.startswith('# End Library'):
return res.rstrip()
self.line += 1
res = self.f.readline()
@ -635,7 +635,7 @@ class SymLib(object):
if not line.startswith('EESchema-LIBRARY'):
raise SchLibError('Missing library signature', line, f)
line = f.get_line()
while not line.startswith('#End Library'):
while not (line.startswith('#End Library') or line.startswith('# End Library')):
if line.startswith('DEF'):
o = LibComponent(line, f, file)
if o.name: