Skip to content

Commit fa9761f

Browse files
committed
[terminology] add function to find cached repos that define ...
a certain section type
1 parent 133d885 commit fa9761f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

odml/terminology.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,20 @@ def get_section_by_type(section_type, pattern=None, relaxed=False):
259259
"""
260260
return terminologies._get_section_by_type(section_type, pattern, relaxed)
261261

262+
def find_definitions(section_type):
263+
"""
264+
Finds repositories that define the provided section type.
265+
266+
@param section_type the requested section type
267+
268+
@return list of tuples containing the repository and the path at which the respective
269+
section can be found. List may be empty.
270+
"""
271+
tl = terminologies.type_list()
272+
if section_type in tl:
273+
return tl[section_type]
274+
else:
275+
return []
262276

263277
if __name__ == "__main__":
264278
from IPython import embed

0 commit comments

Comments
 (0)