kicad: Fix Footprint.property_value
This commit is contained in:
parent
9f2f1f97f9
commit
0799cc55ad
1 changed files with 7 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue