aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2020-10-09 12:15:24 -0400
committerMarkus Armbruster <armbru@redhat.com>2020-10-10 11:37:46 +0200
commitadcb9b36c9b0a63e3b0cf81994430cfb0d720571 (patch)
tree0489b8cea9f6ec7766c74258839a1c0bdf2eb37b /scripts
parent1ec43ca42e153414f586aeda45f37acffbfd1ca1 (diff)
qapi: modify docstrings to be sphinx-compatible
A precise style guide and a package-wide overhaul is forthcoming pending further discussion and consensus. For now, merely avoid obvious errors that cause Sphinx documentation build problems, using a style loosely based on PEP 257 and Sphinx Autodoc. It is chosen for interoperability with our existing Sphinx framework, and because it has loose recognition in the Pycharm IDE. See also: https://www.python.org/dev/peps/pep-0257/ https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20201009161558.107041-3-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi/gen.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py
index ca66c82b5b..dc7b94aa11 100644
--- a/scripts/qapi/gen.py
+++ b/scripts/qapi/gen.py
@@ -154,9 +154,11 @@ class QAPIGenH(QAPIGenC):
@contextmanager
def ifcontext(ifcond, *args):
- """A 'with' statement context manager to wrap with start_if()/end_if()
+ """
+ A with-statement context manager that wraps with `start_if()` / `end_if()`.
- *args: any number of QAPIGenCCode
+ :param ifcond: A list of conditionals, passed to `start_if()`.
+ :param args: any number of `QAPIGenCCode`.
Example::