aboutsummaryrefslogtreecommitdiff
path: root/src/ee/part
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-03-14 06:27:16 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-03-15 08:22:02 +0100
commit8d17fb5bc4b0dae0758e01a44d77d87acf2e686a (patch)
treea13ed043962b8a8da355bba956dc9e77b7fb217e /src/ee/part
parent2315d1a34cb777f1731368619a4ca14f46125bb4 (diff)
downloadee-python-8d17fb5bc4b0dae0758e01a44d77d87acf2e686a.tar.gz
ee-python-8d17fb5bc4b0dae0758e01a44d77d87acf2e686a.tar.bz2
ee-python-8d17fb5bc4b0dae0758e01a44d77d87acf2e686a.tar.xz
ee-python-8d17fb5bc4b0dae0758e01a44d77d87acf2e686a.zip
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.
Diffstat (limited to 'src/ee/part')
-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)