From 8d17fb5bc4b0dae0758e01a44d77d87acf2e686a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 14 Mar 2019 06:27:16 +0100 Subject: o Adding module for searching on element14. o Starting on functionality create orders. Very WIP. o Adding a concept of an "ee project". Can load a gitconfig-like config file. o Adding a tool to import a yaml file into a part xml file. --- src/ee/part/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ee/part') diff --git a/src/ee/part/__init__.py b/src/ee/part/__init__.py index d4d99ac..26bc26c 100644 --- a/src/ee/part/__init__.py +++ b/src/ee/part/__init__.py @@ -40,8 +40,9 @@ class PartDb(object): if e.new: self.new_entries = self.new_entries + 1 - def iterparts(self) -> Iterator[bomFile.Part]: - return [e.part for e in self.parts] + def iterparts(self, sort=False) -> Iterator[bomFile.Part]: + it = (e.part for e in self.parts) + return sorted(it, key=lambda p: p.idProp) if sort else it def size(self) -> int: return len(self.parts) -- cgit v1.2.3