aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-02-21 22:27:36 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-02-21 22:27:36 +0100
commit1c669ec2bbdf923905953f4f149514d3fba4c384 (patch)
tree12d12c1f392eaca4a5371e313e37c4993dc43dd2
parentd9cf71000fb7c2197d05bae1c7bce47af5297aa5 (diff)
downloadee-python-1c669ec2bbdf923905953f4f149514d3fba4c384.tar.gz
ee-python-1c669ec2bbdf923905953f4f149514d3fba4c384.tar.bz2
ee-python-1c669ec2bbdf923905953f4f149514d3fba4c384.tar.xz
ee-python-1c669ec2bbdf923905953f4f149514d3fba4c384.zip
o Working dpn strategy.
-rw-r--r--src/ee/kicad/make_bom.py8
1 files changed, 5 insertions, 3 deletions
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