From 0799cc55adc096b488820ebac46fbb4c54b24e45 Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 5 Jul 2023 17:33:29 +0200 Subject: kicad: Fix Footprint.property_value --- gerbonara/cad/kicad/footprints.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gerbonara/cad') diff --git a/gerbonara/cad/kicad/footprints.py b/gerbonara/cad/kicad/footprints.py index 82c0d62..9772b55 100644 --- a/gerbonara/cad/kicad/footprints.py +++ b/gerbonara/cad/kicad/footprints.py @@ -616,9 +616,14 @@ class Footprint: pad.footprint = self def property_value(self, key, default=_MISSING): - if default is not _MISSING and key not in self.properties: + for prop in self.properties: + if prop.key == key: + return prop.value + + if default is not _MISSING: return default - return self.properties[key].value + + raise IndexError(f'Footprint has no property named "{key}"') @property def pads_by_number(self): -- cgit