diff options
Diffstat (limited to 'src/ee/xml')
-rw-r--r-- | src/ee/xml/bom_file_utils.py | 5 |
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) |