From 5887305b3869665f3931895286c5c99c56454ab9 Mon Sep 17 00:00:00 2001 From: Diego Capusotto Date: Fri, 17 Dec 2021 14:24:41 -0300 Subject: [PATCH] v6 loader: added support for missing components --- kibot/kicad/v6_sch.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kibot/kicad/v6_sch.py b/kibot/kicad/v6_sch.py index 2eed618e..efffc84f 100644 --- a/kibot/kicad/v6_sch.py +++ b/kibot/kicad/v6_sch.py @@ -15,7 +15,7 @@ from copy import deepcopy from collections import OrderedDict from ..gs import GS from .. import log -from ..misc import W_NOLIB, W_UNKFLD +from ..misc import W_NOLIB, W_UNKFLD, W_MISSCMP from .v5_sch import SchError, SchematicComponent, Schematic from .sexpdata import load, SExpData, Symbol @@ -1128,7 +1128,11 @@ class SchematicV6(Schematic): comp.value = s.value comp.set_footprint(s.footprint) # Link with its library symbol - lib_symbol = self.lib_symbol_names[comp.lib_id] + try: + lib_symbol = self.lib_symbol_names[comp.lib_id] + except KeyError: + logger.warning(W_MISSCMP+'Missing component `{}`'.format(comp.lib_id)) + lib_symbol = LibComponent() comp.lib_symbol = lib_symbol comp.is_power = lib_symbol.is_power # Add it to the list