finally:
self._curr_ent = None
+ def set_namespace(self, namespace: str, source: str, lineno: int) -> None:
+ self.add_line_raw(
+ f".. qapi:namespace:: {namespace}", source, lineno + 1
+ )
+ self.ensure_blank_line()
+
class QAPISchemaGenDepVisitor(QAPISchemaVisitor):
"""A QAPI schema visitor which adds Sphinx dependencies each module
optional_arguments = 1
option_spec = {
"qapifile": directives.unchanged_required,
+ "namespace": directives.unchanged,
"transmogrify": directives.flag,
}
has_content = False
vis = Transmogrifier()
modules = set()
+ if "namespace" in self.options:
+ vis.set_namespace(
+ self.options["namespace"], *self.get_source_info()
+ )
+
for doc in schema.docs:
module_source = doc.info.fname
if module_source not in modules: