Added support for KiCad symbol libs without EOF comment.

This commit is contained in:
Salvador E. Tropea 2021-10-18 14:45:58 -03:00
parent a136c2f7e7
commit f752a72bfe
2 changed files with 11 additions and 2 deletions

View File

@ -18,7 +18,7 @@ from .config import KiConf, un_quote
from ..gs import GS
from ..misc import (W_BADPOLI, W_POLICOORDS, W_BADSQUARE, W_BADCIRCLE, W_BADARC, W_BADTEXT, W_BADPIN, W_BADCOMP, W_BADDRAW,
W_UNKDCM, W_UNKAR, W_ARNOPATH, W_ARNOREF, W_MISCFLD, W_EXTRASPC, W_NOLIB, W_INCPOS, W_NOANNO, W_MISSLIB,
W_MISSDCM, W_MISSCMP, W_MISFLDNAME)
W_MISSDCM, W_MISSCMP, W_MISFLDNAME, W_NOENDLIB)
from .. import log
logger = log.get_logger(__name__)
@ -510,6 +510,10 @@ class LibComponent(object):
self.draw = []
line = f.get_line()
while not line.startswith('ENDDEF'):
if len(line) == 0:
# Skip empty lines
line = f.get_line()
continue
if line[0] == 'F':
# A field
field = LibComponentField.parse(line, lib_name, f)
@ -655,7 +659,11 @@ class SymLib(object):
self.alias[a] = o
else:
raise SchLibError('Unknown library entry', line, f)
line = f.get_line()
try:
line = f.get_line()
except SchLibError:
logger.warning(W_NOENDLIB + 'Library without end of file comment: `{}`'.format(file))
break
class DocLibEntry(object):

View File

@ -201,6 +201,7 @@ W_NOKICOST = '(W066) '
W_UNKOUT = '(W067) '
W_NOFILTERS = '(W068) '
W_NOVARIANTS = '(W069) '
W_NOENDLIB = '(W070) '
class Rect(object):