aboutsummaryrefslogtreecommitdiff
path: root/src/ee/kicad/to_bom.py
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-09-24 09:46:21 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-09-24 09:46:21 +0200
commit930e3d61917bd4bf162142db64301691afdf9539 (patch)
treef2e06b6aef12026a5f99742ca78f178f63f5037b /src/ee/kicad/to_bom.py
parent33a03ca8cb65202509bd009832010f8f587ace47 (diff)
downloadee-python-930e3d61917bd4bf162142db64301691afdf9539.tar.gz
ee-python-930e3d61917bd4bf162142db64301691afdf9539.tar.bz2
ee-python-930e3d61917bd4bf162142db64301691afdf9539.tar.xz
ee-python-930e3d61917bd4bf162142db64301691afdf9539.zip
o Let digikey-download-facts read .sch files directly.
Diffstat (limited to 'src/ee/kicad/to_bom.py')
-rw-r--r--src/ee/kicad/to_bom.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ee/kicad/to_bom.py b/src/ee/kicad/to_bom.py
index d684486..ecab211 100644
--- a/src/ee/kicad/to_bom.py
+++ b/src/ee/kicad/to_bom.py
@@ -34,7 +34,11 @@ def comp(c: Component) -> Element:
return comp
-def to_bom(schematic: Schematic) -> Element:
+def to_bom(schematic: Schematic) -> Component:
+ return [c for c in sorted(schematic.components) if c.ref_type != "#PWR" and c.ref_type != "#FLG"]
+
+
+def to_bom_xml(schematic: Schematic) -> Element:
root = Element("export")
root.attrib["version"] = "D"
design = Element("design")
@@ -42,6 +46,6 @@ def to_bom(schematic: Schematic) -> Element:
components = Element("components")
root.append(components)
- [components.append(comp(c)) for c in sorted(schematic.components) if c.ref_type != "#PWR" and c.ref_type != "#FLG"]
+ [components.append(comp(c)) for c in to_bom(schematic)]
return root