From 1c669ec2bbdf923905953f4f149514d3fba4c384 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 21 Feb 2019 22:27:36 +0100 Subject: o Working dpn strategy. --- src/ee/kicad/make_bom.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ee/kicad') diff --git a/src/ee/kicad/make_bom.py b/src/ee/kicad/make_bom.py index 3fa102f..e061f15 100644 --- a/src/ee/kicad/make_bom.py +++ b/src/ee/kicad/make_bom.py @@ -71,9 +71,11 @@ def dpn_strategy_factory(dpn_mappings: Mapping[str, str]) -> StrategyCallable: def dpn_strategy(component: Component, part: bomFile.Part) -> bomFile.Part: for field_name, distributor in dpn_mappings: s = component.get_field(field_name) - if s is not None: - pn = bomFile.PartNumber(value=s, distributor=distributor) - part.part_numbersProp.add_part_number(pn) + if s is None: + continue + + pn = bomFile.PartNumber(value=s.value, distributor=distributor) + part.part_numbersProp.add_part_number(pn) return part -- cgit v1.2.3