aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2025-03-10 23:42:32 -0400
committerMarkus Armbruster <armbru@redhat.com>2025-03-11 10:10:57 +0100
commitd7ca9a3a4c55cba910a3556544e90aadd92c4efe (patch)
tree870493516b42fc69ea894e563511dd5ed0b9e2eb /scripts/qapi
parent323c668934a650673548088c6718c633b57b6ce5 (diff)
downloadqemu-d7ca9a3a4c55cba910a3556544e90aadd92c4efe.zip
qemu-d7ca9a3a4c55cba910a3556544e90aadd92c4efe.tar.gz
qemu-d7ca9a3a4c55cba910a3556544e90aadd92c4efe.tar.bz2
qapi/schema: add __repr__ to QAPIDoc.Section
Makes debugging far more pleasant when you can just print(section) and get something reasonable to display. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-35-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi')
-rw-r--r--scripts/qapi/parser.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 94d5322..11c11bb 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -668,6 +668,9 @@ class QAPIDoc:
# section text without tag
self.text = ''
+ def __repr__(self) -> str:
+ return f"<QAPIDoc.Section kind={self.kind!r} text={self.text!r}>"
+
def append_line(self, line: str) -> None:
self.text += line + '\n'