From b9c8e02072ea6da04ddc9fe9795f699697f25d07 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 21 Feb 2019 08:18:52 +0100 Subject: o Reformat. to_bom: export to_tom_xml too. model: o More type annotations. o Parse ref_type and ref_num when constructed. --- src/ee/kicad/to_bom.py | 4 ++-- 1 file changed, 2 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 62eb075..5c3d988 100644 --- a/src/ee/kicad/to_bom.py +++ b/src/ee/kicad/to_bom.py @@ -2,7 +2,7 @@ from typing import Iterable from xml.etree.ElementTree import Element from ee.kicad.model import * -__all__ = ["to_bom"] +__all__ = ["to_bom", "to_bom_xml"] def simple_element(parent, e, text): @@ -36,7 +36,7 @@ def comp(c: Component) -> Element: def to_bom(schematic: Schematic) -> Iterable[Component]: - return [c for c in sorted(schematic.components) if c.ref_type != "#PWR" and c.ref_type != "#FLG"] + return [c for c in sorted(schematic.components) if c.has_ref_num and c.ref_type != "#PWR" and c.ref_type != "#FLG"] def to_bom_xml(schematic: Schematic) -> Element: -- cgit v1.2.3