aboutsummaryrefslogtreecommitdiff
path: root/src/ee/element14
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-03-15 14:55:15 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-03-15 14:55:15 +0100
commit237a6faa8a23826e68bbc00bc107b2d6f97235d0 (patch)
treefe1a6a6b1a4ed991a6eacd9ec6960325db3f9e4f /src/ee/element14
parent3523190bb7ca1c38caea3a1aae51062d22e56b09 (diff)
downloadee-python-237a6faa8a23826e68bbc00bc107b2d6f97235d0.tar.gz
ee-python-237a6faa8a23826e68bbc00bc107b2d6f97235d0.tar.bz2
ee-python-237a6faa8a23826e68bbc00bc107b2d6f97235d0.tar.xz
ee-python-237a6faa8a23826e68bbc00bc107b2d6f97235d0.zip
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 <schema-reference> and <part-numbers> into <references> o Creating <part-uri> as a possible <reference>. Used by order to point to other parts.
Diffstat (limited to 'src/ee/element14')
-rw-r--r--src/ee/element14/search_parts.py8
1 files changed, 4 insertions, 4 deletions
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)