python: Fix broken ReST docstrings

This patch *doesn't* update all of the docstring standards across the
QEMU package directory to make our docstring usage consistent. It
*doesn't* fix the formatting to make it look pretty or reasonable in
generated output. It *does* fix a few small instances where Sphinx would
emit a build warning because of malformed ReST -- If we built our Python
docs with Sphinx.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-id: 20210629214323.1329806-16-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
John Snow 2021-06-29 17:43:23 -04:00
parent 19cf0031e4
commit 5c02c86586
5 changed files with 8 additions and 6 deletions

View file

@ -4,10 +4,10 @@ QEMU development and testing library.
This library provides a few high-level classes for driving QEMU from a This library provides a few high-level classes for driving QEMU from a
test suite, not intended for production use. test suite, not intended for production use.
- QEMUMachine: Configure and Boot a QEMU VM | QEMUQtestProtocol: send/receive qtest messages.
- QEMUQtestMachine: VM class, with a qtest socket. | QEMUMachine: Configure and Boot a QEMU VM
| +-- QEMUQtestMachine: VM class, with a qtest socket.
- QEMUQtestProtocol: Connect to, send/receive qtest messages.
""" """
# Copyright (C) 2020-2021 John Snow for Red Hat Inc. # Copyright (C) 2020-2021 John Snow for Red Hat Inc.

View file

@ -545,7 +545,8 @@ class QEMUMachine:
@param enabled: if False, qmp monitor options will be removed from @param enabled: if False, qmp monitor options will be removed from
the base arguments of the resulting QEMU command the base arguments of the resulting QEMU command
line. Default is True. line. Default is True.
@note: call this function before launch().
.. note:: Call this function before launch().
""" """
self._qmp_set = enabled self._qmp_set = enabled

View file

@ -279,6 +279,7 @@ class QEMUMonitorProtocol:
None). The value passed will set the behavior of the None). The value passed will set the behavior of the
underneath QMP socket as described in [1]. underneath QMP socket as described in [1].
Default value is set to 15.0. Default value is set to 15.0.
@return QMP greeting dict @return QMP greeting dict
@raise OSError on socket connection errors @raise OSError on socket connection errors
@raise QMPConnectError if the greeting is not received @raise QMPConnectError if the greeting is not received

View file

@ -156,7 +156,7 @@ class QOMCommand:
""" """
Run a fully-parsed subcommand, with error-handling for the CLI. Run a fully-parsed subcommand, with error-handling for the CLI.
:return: The return code from `.run()`. :return: The return code from `run()`.
""" """
try: try:
cmd = cls(args) cmd = cls(args)

View file

@ -36,7 +36,7 @@ def list_accel(qemu_bin: str) -> List[str]:
List accelerators enabled in the QEMU binary. List accelerators enabled in the QEMU binary.
@param qemu_bin (str): path to the QEMU binary. @param qemu_bin (str): path to the QEMU binary.
@raise Exception: if failed to run `qemu -accel help` @raise Exception: if failed to run ``qemu -accel help``
@return a list of accelerator names. @return a list of accelerator names.
""" """
if not qemu_bin: if not qemu_bin: