diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-11-05 11:44:50 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-11-05 11:44:50 +0100 |
commit | 354ad672d85a0ae5ab7e8380d786a12c2859f0cd (patch) | |
tree | d07c08eb8b50391f3b0396e8fc6410dab3853b57 | |
parent | items: Add Link.__setitem__() (diff) | |
download | rtems-central-354ad672d85a0ae5ab7e8380d786a12c2859f0cd.tar.bz2 |
glossary: Remove global state
Initialize the dictionaries each time the glossary() function is called.
-rw-r--r-- | rtemsspec/glossary.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rtemsspec/glossary.py b/rtemsspec/glossary.py index c7445874..21a39e89 100644 --- a/rtemsspec/glossary.py +++ b/rtemsspec/glossary.py @@ -36,8 +36,8 @@ ItemMap = Dict[str, Item] class _Glossary(NamedTuple): """ A glossary of terms. """ - uid_to_item: ItemMap = {} - term_to_item: ItemMap = {} + uid_to_item: ItemMap + term_to_item: ItemMap def _gather_glossary_terms(item: Item, glossary: _Glossary) -> None: @@ -132,7 +132,7 @@ def generate(config: dict, item_cache: ItemCache) -> None: if item.type == "glossary/group": groups[uid] = item - project_glossary = _Glossary() + project_glossary = _Glossary({}, {}) for group in config["project-groups"]: _gather_glossary_terms(groups[group], project_glossary) |