aboutsummaryrefslogtreecommitdiff
path: root/src/ee/part
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-28 14:47:24 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-28 14:47:24 +0200
commit79ee5e3c64c0140a61324914d24049478a9cf7f5 (patch)
treee149c918cbf19881b7c05a3f5b29e303a4b529f8 /src/ee/part
parentb4ba5e8385965a8b6ec7decd83ff7f07c9b364ec (diff)
downloadee-python-79ee5e3c64c0140a61324914d24049478a9cf7f5.tar.gz
ee-python-79ee5e3c64c0140a61324914d24049478a9cf7f5.tar.bz2
ee-python-79ee5e3c64c0140a61324914d24049478a9cf7f5.tar.xz
ee-python-79ee5e3c64c0140a61324914d24049478a9cf7f5.zip
create-bom: Don't skip unmatched parts from the BOM.
part-validate-parts: Read parts from the schematic, BOM and supplier's parts for even better rules. Enhancing footprint rule to check that the BOM part has the same footprint.
Diffstat (limited to 'src/ee/part')
-rw-r--r--src/ee/part/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ee/part/__init__.py b/src/ee/part/__init__.py
index 3ce255e..c18dd02 100644
--- a/src/ee/part/__init__.py
+++ b/src/ee/part/__init__.py
@@ -237,6 +237,9 @@ class Part(object):
def get_part_references(self) -> List[types.PartReference]:
return self.xml.referencesProp.part_referenceProp
+ def get_only_part_reference(self) -> Optional[types.PartReference]:
+ return next(iter(self.get_part_references()), None)
+
def get_exactly_one_part_reference(self) -> types.PartReference:
refs = self.get_part_references()
if len(refs) == 0: