From 237a6faa8a23826e68bbc00bc107b2d6f97235d0 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 15 Mar 2019 14:55:15 +0100 Subject: Refactoring: o Renaming part.id to part.uri. Changing to URIs and use that as an identifier if the part is known. Schematic part does not have an URI. o Merging and into o Creating as a possible . Used by order to point to other parts. --- src/ee/element14/search_parts.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ee/element14') diff --git a/src/ee/element14/search_parts.py b/src/ee/element14/search_parts.py index 55e8130..cfa1d34 100644 --- a/src/ee/element14/search_parts.py +++ b/src/ee/element14/search_parts.py @@ -14,9 +14,9 @@ def search_parts(in_path: Path, out_path: Path, cache_dir: Path, config: Element client = Element14Client(config, cache_dir) for part in in_db.iterparts(): - mpn = bom_file_utils.find_pn(part) + mpn = bom_file_utils.first_pn(part) - query = mpn # TODO: suppor dpn + query = mpn # TODO: support dpn out_id = query @@ -24,8 +24,8 @@ def search_parts(in_path: Path, out_path: Path, cache_dir: Path, config: Element out_part = types.Part(id=out_id, distributor_info=types.DistributorInfo(), - part_numbers=part.part_numbersProp) + references=part.referencesProp) di = out_part.distributor_infoProp print("Saving {} work parts".format(out_parts.size())) - save_db(out_path, out_parts) + save_db(out_path, out_parts, sort=True) -- cgit v1.2.3