aboutsummaryrefslogtreecommitdiff
path: root/src/ee/digikey
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-08-19 10:21:25 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-08-19 10:21:25 +0200
commit1f2bf08018de022890025618094326bd6556997d (patch)
tree21b50f25e3f3fe261a6bf17e5fcd9d205b198c14 /src/ee/digikey
parent5f12ee84322731ce9b846a27852999ff219c75b5 (diff)
downloadee-python-1f2bf08018de022890025618094326bd6556997d.tar.gz
ee-python-1f2bf08018de022890025618094326bd6556997d.tar.bz2
ee-python-1f2bf08018de022890025618094326bd6556997d.tar.xz
ee-python-1f2bf08018de022890025618094326bd6556997d.zip
digikey-search-parts: Sorting summary statistics so the output is
consistent.
Diffstat (limited to 'src/ee/digikey')
-rw-r--r--src/ee/digikey/search_parts.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ee/digikey/search_parts.py b/src/ee/digikey/search_parts.py
index 703e65f..144b254 100644
--- a/src/ee/digikey/search_parts.py
+++ b/src/ee/digikey/search_parts.py
@@ -262,7 +262,7 @@ def run_search_parts(in_path: Path, out_path: Path, log, cache_dir: Path, store_
for name, results in [("MPN", mpn_results), ("SPN", spn_results)]:
print("{} Searches:\n".format(name), file=log)
- for res, count in results.items():
+ for res, count in sorted([(res, count) for res, count in results.items()], key=lambda x: x[0].value):
print("* {}: {}".format(res.name, count), file=log)
print("", file=log)