[rtems-central commit] interfacedoc: Use item.type

Sebastian Huber sebh at rtems.org
Sun Oct 11 13:21:03 UTC 2020


Module:    rtems-central
Branch:    master
Commit:    a8a6429dcd9e808fedae14ef5ede5470d89ccbe6
Changeset: http://git.rtems.org/rtems-central/commit/?id=a8a6429dcd9e808fedae14ef5ede5470d89ccbe6

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Sun Oct 11 14:56:38 2020 +0200

interfacedoc: Use item.type

---

 rtemsspec/interfacedoc.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/rtemsspec/interfacedoc.py b/rtemsspec/interfacedoc.py
index ed6a7e3..5abc8b5 100644
--- a/rtemsspec/interfacedoc.py
+++ b/rtemsspec/interfacedoc.py
@@ -117,7 +117,7 @@ def _add_definition(content: CContent, mapper: ItemMapper, item: Item,
                     prefix: str, value: Dict[str, Any],
                     add_definition: AddDefinition) -> None:
     # pylint: disable=too-many-arguments
-    assert item["interface-type"] == "function"
+    assert item.type == "interface/function"
     default = value["default"]
     variants = value["variants"]
     if variants:
@@ -227,10 +227,9 @@ def generate(config: list, item_cache: ItemCache) -> None:
     for doc_config in config:
         items = []  # type: List[Item]
         group = item_cache[doc_config["group"]]
-        assert group["type"] == "interface"
-        assert group["interface-type"] == "group"
+        assert group.type == "interface/group"
         for child in group.children("interface-ingroup"):
-            if child["interface-type"] == "function":
+            if child.type == "interface/function":
                 items.append(child)
         items.sort(key=functools.partial(
             _directive_key, list(group.parents("placement-order"))))



More information about the vc mailing list