All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Cleber Rosa <crosa@redhat.com>,
	John Snow <jsnow@redhat.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: [PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen property
Date: Tue, 22 Sep 2020 17:17:59 -0400	[thread overview]
Message-ID: <20200922211802.4083666-12-jsnow@redhat.com> (raw)
In-Reply-To: <20200922211802.4083666-1-jsnow@redhat.com>

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



  parent reply	other threads:[~2020-09-22 22:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 21:17 [PATCH 00/14] qapi: static typing conversion, pt3 John Snow
2020-09-22 21:17 ` [PATCH 01/14] qapi/doc.py: stash long temporary locals in named locals John Snow
2020-09-23 20:46   ` Eduardo Habkost
2020-09-22 21:17 ` [PATCH 02/14] qapi/doc.py: avoid unnecessary keyword arguments John Snow
2020-09-23 20:46   ` Eduardo Habkost
2020-09-22 21:17 ` [PATCH 03/14] qapi/doc.py: Add assertion on section.member John Snow
2020-09-23 20:46   ` Eduardo Habkost
2020-09-22 21:17 ` [PATCH 04/14] qapi/doc.py: assert correct types in member_func callbacks John Snow
2020-09-23 20:46   ` Eduardo Habkost
2020-09-22 21:17 ` [PATCH 05/14] qapi/doc.py: Assert no suffix given for enum members John Snow
2020-09-23 20:47   ` Eduardo Habkost
2020-09-22 21:17 ` [PATCH 06/14] qapi/doc.py: Add type hint annotations John Snow
2020-09-23 20:47   ` Eduardo Habkost
2020-09-22 21:17 ` [PATCH 07/14] qapi/doc.py: enable mypy checks John Snow
2020-09-23 20:47   ` Eduardo Habkost
2020-09-22 21:17 ` [PATCH 08/14] qapi/doc.py: Add generic texi_member callback John Snow
2020-09-22 21:17 ` [PATCH 09/14] qapi/doc.py: Remove one-letter variables John Snow
2020-09-23 21:00   ` Eduardo Habkost
2020-09-22 21:17 ` [PATCH 10/14] qapi/gen.py: Add __bool__ dunder method to QAPIGen John Snow
2020-09-23 21:05   ` Eduardo Habkost
2020-09-22 21:17 ` John Snow [this message]
2020-09-23 21:05   ` [PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen property Eduardo Habkost
2020-09-22 21:18 ` [PATCH 12/14] qapi/doc.py: Assert tag member is Enum type John Snow
2020-09-23 21:07   ` Eduardo Habkost
2020-09-22 21:18 ` [PATCH 13/14] qapi/doc.py: Assert type of object variant John Snow
2020-09-23 21:08   ` Eduardo Habkost
2020-09-22 21:18 ` [PATCH 14/14] qapi/doc.py: enable pylint checks John Snow
2020-09-23 21:09   ` Eduardo Habkost
2020-09-30  4:44 ` [PATCH 00/14] qapi: static typing conversion, pt3 John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200922211802.4083666-12-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.