From 79ee5e3c64c0140a61324914d24049478a9cf7f5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 28 May 2019 14:47:24 +0200 Subject: 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. --- src/ee/part/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ee/part') 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: -- cgit v1.2.3