diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-02 16:01:14 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-07 11:31:07 +0200 |
commit | 262d847ae63e1746bd050e7e45f1a36fec54b56a (patch) | |
tree | b33bcfe0e5b0da85be58b936d4a3df7d5eabe7fe | |
parent | items: Allow multiple roles to follow links (diff) | |
download | rtems-central-262d847ae63e1746bd050e7e45f1a36fec54b56a.tar.bz2 |
glossary: Simplify
-rw-r--r-- | rtemsspec/glossary.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/rtemsspec/glossary.py b/rtemsspec/glossary.py index 1131f45b..bb0bf495 100644 --- a/rtemsspec/glossary.py +++ b/rtemsspec/glossary.py @@ -40,13 +40,6 @@ class _Glossary(NamedTuple): term_to_item: ItemMap = {} -def _gather_glossary_groups(item: Item, glossary_groups: ItemMap) -> None: - for child in item.children(): - _gather_glossary_groups(child, glossary_groups) - if item["type"] == "glossary" and item["glossary-type"] == "group": - glossary_groups[item.uid] = item - - def _gather_glossary_terms(item: Item, glossary: _Glossary) -> None: for child in item.children(): _gather_glossary_terms(child, glossary) @@ -126,8 +119,9 @@ def generate(config: dict, item_cache: ItemCache) -> None: groups and terms. """ groups = {} # type: ItemMap - for item in item_cache.top_level.values(): - _gather_glossary_groups(item, groups) + for uid, item in item_cache.all.items(): + if item.type == "glossary/group": + groups[uid] = item project_glossary = _Glossary() for group in config["project-groups"]: |