summaryrefslogtreecommitdiff
path: root/gerbonara/cad/kicad
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-07-05 17:33:29 +0200
committerjaseg <git@jaseg.de>2023-07-05 17:33:29 +0200
commit0799cc55adc096b488820ebac46fbb4c54b24e45 (patch)
treebdf5b7dedffe4a9ff2034e06ec77f8194dcf6890 /gerbonara/cad/kicad
parent9f2f1f97f9f361add53c2fab6901dec4de087b6f (diff)
downloadgerbonara-0799cc55adc096b488820ebac46fbb4c54b24e45.tar.gz
gerbonara-0799cc55adc096b488820ebac46fbb4c54b24e45.tar.bz2
gerbonara-0799cc55adc096b488820ebac46fbb4c54b24e45.zip
kicad: Fix Footprint.property_value
Diffstat (limited to 'gerbonara/cad/kicad')
-rw-r--r--gerbonara/cad/kicad/footprints.py9
1 files changed, 7 insertions, 2 deletions
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):