From 3523190bb7ca1c38caea3a1aae51062d22e56b09 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 15 Mar 2019 10:55:06 +0100 Subject: o Switching PartDb to serialize into many xml files into a single document. --- src/ee/digikey/normalize_facts.py | 8 +++----- src/ee/digikey/search_parts.py | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src/ee/digikey') diff --git a/src/ee/digikey/normalize_facts.py b/src/ee/digikey/normalize_facts.py index 91e8c07..91ad4db 100644 --- a/src/ee/digikey/normalize_facts.py +++ b/src/ee/digikey/normalize_facts.py @@ -113,10 +113,8 @@ parsers: Mapping[int, Callable[[str], Any]] = { } -def normalize_facts(in_dir: Path, out_dir: Path): - print("in: {}, out: {}".format(in_dir, out_dir)) - - in_db = load_db(in_dir) +def normalize_facts(in_path: Path, out_path: Path): + in_db = load_db(in_path) out_parts = PartDb() for part in in_db.iterparts(): # type: types.Part @@ -155,4 +153,4 @@ def normalize_facts(in_dir: Path, out_dir: Path): out_parts.add_entry(part, True) print("Saving {} work parts".format(out_parts.size())) - save_db(out_dir, out_parts) + save_db(out_path, out_parts) diff --git a/src/ee/digikey/search_parts.py b/src/ee/digikey/search_parts.py index 4203624..4f637c7 100644 --- a/src/ee/digikey/search_parts.py +++ b/src/ee/digikey/search_parts.py @@ -38,10 +38,8 @@ def resolved(p: DigikeyProduct) -> types.Part: return part -def search_parts(in_dir: Path, out_dir: Path, cache_dir: Path, force_refresh: bool): - print("in: {}, out: {}".format(in_dir, out_dir)) - - in_db = load_db(in_dir) +def search_parts(in_path: Path, out_path: Path, cache_dir: Path): + in_db = load_db(in_path) out_parts = PartDb() parser = DigikeyParser(Digikey()) @@ -103,4 +101,4 @@ def search_parts(in_dir: Path, out_dir: Path, cache_dir: Path, force_refresh: bo out_parts.add_entry(out_part, True) print("Saving {} work parts".format(out_parts.size())) - save_db(out_dir, out_parts) + save_db(out_path, out_parts) -- cgit v1.2.3