[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen prope
From: |
John Snow |
Subject: |
[PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen property |
Date: |
Tue, 22 Sep 2020 17:17:59 -0400 |
Use the new __bool__ method to do the same without exposing the private
attribute.
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/doc.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
index 5f2b0cd51d..2914e93b1c 100644
--- a/scripts/qapi/doc.py
+++ b/scripts/qapi/doc.py
@@ -344,7 +344,7 @@ def visit_event(self,
self._gen.add(texi_msg('Event', doc, ifcond, members))
def symbol(self, doc: QAPIDoc, entity: QAPISchemaEntity) -> None:
- if self._gen._body:
+ if self._gen:
self._gen.add('\n')
self.cur_doc = doc
entity.visit(self)
@@ -352,7 +352,7 @@ def symbol(self, doc: QAPIDoc, entity: QAPISchemaEntity) ->
None:
def freeform(self, doc: QAPIDoc) -> None:
assert not doc.args
- if self._gen._body:
+ if self._gen:
self._gen.add('\n')
self._gen.add(texi_body(doc) + texi_sections(doc, None))
--
2.26.2
- [PATCH 03/14] qapi/doc.py: Add assertion on section.member, (continued)
- [PATCH 03/14] qapi/doc.py: Add assertion on section.member, John Snow, 2020/09/22
- [PATCH 07/14] qapi/doc.py: enable mypy checks, John Snow, 2020/09/22
- [PATCH 10/14] qapi/gen.py: Add __bool__ dunder method to QAPIGen, John Snow, 2020/09/22
- [PATCH 12/14] qapi/doc.py: Assert tag member is Enum type, John Snow, 2020/09/22
- [PATCH 13/14] qapi/doc.py: Assert type of object variant, John Snow, 2020/09/22
- [PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen property,
John Snow <=
- [PATCH 14/14] qapi/doc.py: enable pylint checks, John Snow, 2020/09/22
- [PATCH 04/14] qapi/doc.py: assert correct types in member_func callbacks, John Snow, 2020/09/22
- [PATCH 05/14] qapi/doc.py: Assert no suffix given for enum members, John Snow, 2020/09/22
- [PATCH 06/14] qapi/doc.py: Add type hint annotations, John Snow, 2020/09/22
- [PATCH 09/14] qapi/doc.py: Remove one-letter variables, John Snow, 2020/09/22