aboutsummaryrefslogtreecommitdiff
path: root/src/ee/kicad/to_bom.py
diff options
context:
space:
mode:
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