aboutsummaryrefslogtreecommitdiff
path: root/src/ee/part/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/part/__init__.py')
-rw-r--r--src/ee/part/__init__.py5
1 files changed, 3 insertions, 2 deletions
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)