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>
This commit is contained in:
John Snow 2025-03-10 23:42:32 -04:00 committed by Markus Armbruster
parent 323c668934
commit d7ca9a3a4c

View file

@ -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'