[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/23] qapi/schema: add __repr__ to QAPIDoc.Section
From: |
John Snow |
Subject: |
[PATCH 05/23] qapi/schema: add __repr__ to QAPIDoc.Section |
Date: |
Thu, 12 Dec 2024 21:18:08 -0500 |
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>
---
scripts/qapi/parser.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index fd841725527..3c88f9c7d38 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -670,6 +670,9 @@ def __init__(
# section text without tag
self.text = ''
+ def __repr__(self) -> str:
+ return f"<QAPIDoc.Section tag={self.tag!r} text={self.text!r}>"
+
def append_line(self, line: str) -> None:
self.text += line + '\n'
--
2.47.0
- [PATCH 01/23] docs/qapidoc: support header-less freeform sections, (continued)
- [PATCH 01/23] docs/qapidoc: support header-less freeform sections, John Snow, 2024/12/12
- [PATCH 03/23] docs/qapidoc: remove example section support, John Snow, 2024/12/12
- [PATCH 02/23] qapi/parser: adjust info location for doc body section, John Snow, 2024/12/12
- [PATCH 04/23] qapi: expand tags to all doc sections, John Snow, 2024/12/12
- [PATCH 05/23] qapi/schema: add __repr__ to QAPIDoc.Section,
John Snow <=
- [PATCH 06/23] docs/qapidoc: add transmogrifier stub, John Snow, 2024/12/12
- [PATCH 07/23] docs/qapidoc: add transmogrifier class stub, John Snow, 2024/12/12
- [PATCH 08/23] docs/qapidoc: add visit_module() method, John Snow, 2024/12/12
- [PATCH 09/23] qapi/source: allow multi-line QAPISourceInfo advancing, John Snow, 2024/12/12
- [PATCH 10/23] docs/qapidoc: add visit_freeform() method, John Snow, 2024/12/12
- [PATCH 11/23] docs/qapidoc: add preamble() method, John Snow, 2024/12/12
- [PATCH 12/23] docs/qapidoc: add visit_paragraph() method, John Snow, 2024/12/12