mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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:
parent
323c668934
commit
d7ca9a3a4c
1 changed files with 3 additions and 0 deletions
|
@ -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'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue