diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-10-25 13:29:14 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-10-25 13:29:14 +0200 |
commit | 1f1d918acf653457fef33d2c7784dd0c71ab513a (patch) | |
tree | 45d513149b671404c8fa5801f7200d34f4580b13 | |
parent | 0105fe08b6de35148c9455af443ca1d0c9437e18 (diff) | |
download | ee-python-1f1d918acf653457fef33d2c7784dd0c71ab513a.tar.gz ee-python-1f1d918acf653457fef33d2c7784dd0c71ab513a.tar.bz2 ee-python-1f1d918acf653457fef33d2c7784dd0c71ab513a.tar.xz ee-python-1f1d918acf653457fef33d2c7784dd0c71ab513a.zip |
pn-part-search-list: Using logger.
-rw-r--r-- | src/ee/part/pn_part_search_list.py | 7 |
1 files changed, 5 insertions, 2 deletions
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) |