@@ -33,15 +33,22 @@
SOURCE_LOCATION_FIX = (5, 3, 0) <= sphinx.version_info[:3] < (6, 2, 0)
+# Alias for the return of QAPIObject.handle_signature(), which is used
+# in several places. (In the Python domain, this type is Tuple[str,
+# str] instead.)
+Signature = str
+
space_node: Callable[[str], Node]
keyword_node: Callable[[str, str], Node]
if sphinx.version_info[:3] >= (4, 0, 0):
space_node = addnodes.desc_sig_space
keyword_node = addnodes.desc_sig_keyword
+ ObjectDesc = ObjectDescription[Signature]
else:
space_node = Text
keyword_node = addnodes.desc_annotation
+ ObjectDesc = ObjectDescription
def nested_parse(directive: SphinxDirective, content_node: Element) -> None:
@@ -26,7 +26,9 @@
from compat import (
Field,
GroupedField,
+ ObjectDesc,
ParserFix,
+ Signature,
TypedField,
keyword_node,
nested_parse,
@@ -164,12 +166,7 @@ def since_validator(param: str) -> str:
return param
-# Alias for the return of handle_signature(), which is used in several places.
-# (In the Python domain, this is Tuple[str, str] instead.)
-Signature = str
-
-
-class QAPIObject(ParserFix, ObjectDescription[Signature]):
+class QAPIObject(ParserFix, ObjectDesc):
"""
Description of a generic QAPI object.
Signed-off-by: John Snow <jsnow@redhat.com> --- docs/sphinx/compat.py | 7 +++++++ docs/sphinx/qapi-domain.py | 9 +++------ 2 files changed, 10 insertions(+), 6 deletions(-)