aboutsummaryrefslogtreecommitdiff
path: root/src/ee/xml
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-03-25 11:55:54 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-03-25 12:58:59 +0100
commit50ee4b871bc9d0076cabaa5d2ea4ad1ba7b8e15a (patch)
tree05ee9273b41efa1d9268b32f829881c6f6d06eaa /src/ee/xml
parentb230198488ef670ed6e374e0d39d5f4e6ac07e8d (diff)
downloadee-python-50ee4b871bc9d0076cabaa5d2ea4ad1ba7b8e15a.tar.gz
ee-python-50ee4b871bc9d0076cabaa5d2ea4ad1ba7b8e15a.tar.bz2
ee-python-50ee4b871bc9d0076cabaa5d2ea4ad1ba7b8e15a.tar.xz
ee-python-50ee4b871bc9d0076cabaa5d2ea4ad1ba7b8e15a.zip
ninja tool: changing to generate the files in the current directory.
build.ninja.j2: nits. olinuxino: Improving parsing of part values.
Diffstat (limited to 'src/ee/xml')
-rw-r--r--src/ee/xml/bom_file_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ee/xml/bom_file_utils.py b/src/ee/xml/bom_file_utils.py
index 207ac5a..97b609f 100644
--- a/src/ee/xml/bom_file_utils.py
+++ b/src/ee/xml/bom_file_utils.py
@@ -42,3 +42,8 @@ def facts(part: types.Part, create=False) -> Optional[types.FactList]:
fs = types.FactList()
part.factsProp = fs
return fs
+
+
+def find_fact(fs: types.FactList, key: str) -> Optional[types.Fact]:
+ l: List[types.Fact] = fs.factProp
+ return next((f for f in l if f.keyProp == key), None)