From 1f1d918acf653457fef33d2c7784dd0c71ab513a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 25 Oct 2019 13:29:14 +0200 Subject: pn-part-search-list: Using logger. --- src/ee/part/pn_part_search_list.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ee/part/pn_part_search_list.py b/src/ee/part/pn_part_search_list.py index 7094c10..4b3e895 100644 --- a/src/ee/part/pn_part_search_list.py +++ b/src/ee/part/pn_part_search_list.py @@ -1,6 +1,7 @@ -from ee.kicad import sch_fact_types from pathlib import Path +from ee.kicad import sch_fact_types +from ee.logging import log from ee.part import PartDb, load_db, save_db, Part, fact_keys, common_fact_types from ee.xml import types, uris @@ -49,12 +50,14 @@ def pn_part_search_list(in_path: Path, out_path: Path, supplier: str): component_type = part.facts.get_value(fact_keys.ee_component_type) if component_type: if component_type in ignored_ee_component_types: + log.info("Skipping part {}: ignored type".format(part.printable_reference)) skipped.append(refs) continue if not valid_pns(part): value = get_value(part) if not value: + log.info("Skipping part {}: no part number".format(part.printable_reference)) skipped.append(refs) continue @@ -67,6 +70,6 @@ def pn_part_search_list(in_path: Path, out_path: Path, supplier: str): out_parts.add_entry(new_part, True) if len(skipped) > 0: - print("Skipped {} of {} parts".format(len(skipped), count)) + log.info("Skipped {} of {} parts".format(len(skipped), count)) save_db(out_path, out_parts) -- cgit v1.2.3