diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-03-15 10:55:06 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-03-15 10:55:06 +0100 |
commit | 3523190bb7ca1c38caea3a1aae51062d22e56b09 (patch) | |
tree | db975c27c38c873a012d88a266ad82621b0859b2 /src/ee/digikey | |
parent | b67aa2b41247991e361dec0963670b4e5108410a (diff) | |
download | ee-python-3523190bb7ca1c38caea3a1aae51062d22e56b09.tar.gz ee-python-3523190bb7ca1c38caea3a1aae51062d22e56b09.tar.bz2 ee-python-3523190bb7ca1c38caea3a1aae51062d22e56b09.tar.xz ee-python-3523190bb7ca1c38caea3a1aae51062d22e56b09.zip |
o Switching PartDb to serialize into many xml files into a single
<part-db> document.
Diffstat (limited to 'src/ee/digikey')
-rw-r--r-- | src/ee/digikey/normalize_facts.py | 8 | ||||
-rw-r--r-- | src/ee/digikey/search_parts.py | 8 |
2 files changed, 6 insertions, 10 deletions
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) |