From 50ee4b871bc9d0076cabaa5d2ea4ad1ba7b8e15a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 25 Mar 2019 11:55:54 +0100 Subject: ninja tool: changing to generate the files in the current directory. build.ninja.j2: nits. olinuxino: Improving parsing of part values. --- src/ee/xml/bom_file_utils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ee/xml') 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) -- cgit v1.2.3