From 0ce5c1e6dcea6643cf72de885c0aca52bf4ac28c Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 27 Feb 2019 16:09:53 +0100 Subject: o Always sorting index.xml for better git diffs. o Normalizing more Digikey facts. o When creating distributor search lists, create a new plain with containing only the part numbers. --- src/ee/part/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ee/part/__init__.py') diff --git a/src/ee/part/__init__.py b/src/ee/part/__init__.py index 84a6174..e0b0087 100644 --- a/src/ee/part/__init__.py +++ b/src/ee/part/__init__.py @@ -91,7 +91,10 @@ def save_db(dir_path: Path, db: PartDb): idx.filesProp = indexFile.FileList() files = idx.filesProp.fileProp - for part in db.iterparts(): + parts = db.iterparts() + parts = sorted(parts, key=lambda p: p.idProp) + + for part in parts: id_ = part.id path = dir_path / "{}.xml".format(id_) with path.open("w") as f: -- cgit v1.2.3