From: John Snow Date: Tue, 11 Mar 2025 03:42:32 +0000 (-0400) Subject: qapi/schema: add __repr__ to QAPIDoc.Section X-Git-Tag: v10.0.0-rc0~11^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7ca9a3a4c55cba910a3556544e90aadd92c4efe;p=thirdparty%2Fqemu.git 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 Message-ID: <20250311034303.75779-35-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 94d5322f8af..11c11bb09e5 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"" + def append_line(self, line: str) -> None: self.text += line + '\n'