qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 14/15] qapi/introspect.py: Add docstring to _tree_to_qlit


From: John Snow
Subject: Re: [PATCH v5 14/15] qapi/introspect.py: Add docstring to _tree_to_qlit
Date: Mon, 8 Feb 2021 10:57:36 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 2/8/21 10:45 AM, Markus Armbruster wrote:
John Snow <jsnow@redhat.com> writes:

Signed-off-by: John Snow <jsnow@redhat.com>
---
  scripts/qapi/introspect.py | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
index 2a39726f40a..2b338abe2cf 100644
--- a/scripts/qapi/introspect.py
+++ b/scripts/qapi/introspect.py
@@ -97,6 +97,14 @@ def __init__(self, value: _NodeT, ifcond: Iterable[str],
  def _tree_to_qlit(obj: TreeValue,
                    level: int = 0,
                    dict_value: bool = False) -> str:
+    """
+    Convert the type tree into a QLIT C string, recursively.
+
+    :param obj: The value to convert.
+    :param level: The indentation level for this particular value.
+    :param dict_value: True when the value being processed belongs to a
+                       dict key; which suppresses the output indent.
+    """
def indent(level: int) -> str:
          return level * 4 * ' '

Might want to mention @obj may not be Annotated when dict_value=True.
Not a demand.


No, that's a good point.

--js




reply via email to

[Prev in Thread] Current Thread [Next in Thread]