From 930e3d61917bd4bf162142db64301691afdf9539 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 24 Sep 2017 09:46:21 +0200 Subject: o Let digikey-download-facts read .sch files directly. --- src/ee/kicad/to_bom.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ee/kicad/to_bom.py') 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 -- cgit v1.2.3