From nobody Mon Feb 9 08:09:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489583626299481.82545117649454; Wed, 15 Mar 2017 06:13:46 -0700 (PDT) Received: from localhost ([::1]:37079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1co8kI-0006Cw-VB for importer@patchew.org; Wed, 15 Mar 2017 09:13:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1co8Ut-0001W5-0q for qemu-devel@nongnu.org; Wed, 15 Mar 2017 08:57:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1co8Uq-0000K0-7h for qemu-devel@nongnu.org; Wed, 15 Mar 2017 08:57:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54462) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1co8Up-0000IN-On for qemu-devel@nongnu.org; Wed, 15 Mar 2017 08:57:43 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD75DF6226; Wed, 15 Mar 2017 12:57:43 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2FCvguk011915 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 Mar 2017 08:57:43 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B66C0113861F; Wed, 15 Mar 2017 13:57:36 +0100 (CET) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AD75DF6226 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AD75DF6226 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 15 Mar 2017 13:57:10 +0100 Message-Id: <1489582656-31133-22-git-send-email-armbru@redhat.com> In-Reply-To: <1489582656-31133-1-git-send-email-armbru@redhat.com> References: <1489582656-31133-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 15 Mar 2017 12:57:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 for-2.9 21/47] qapi2texi: Present the table of members more clearly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The table of members follows the main descriptive text immediately. Makes it hard to see what it is about. Start a new paragraph, and lead with a line "Members:" for object and alternate types, "Values:" for enumeration types, and "Arguments:" for commands and events. Example change (qemu-qmp-ref.txt): -- Command: set_link Sets the link status of a virtual network adapter. + + Arguments: 'name' the device name of the virtual network adapter 'up' true to set the link status to be up Returns: Nothing on success If 'name' is not a valid network device, DeviceNotFound Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi2texi.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index ecfaeda..35e182d 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -139,7 +139,7 @@ def texi_member(member): member.name, ' (optional)' if member.optional else '') =20 =20 -def texi_members(doc, member_func, show_undocumented): +def texi_members(doc, what, member_func, show_undocumented): """Format the table of members""" items =3D '' for section in doc.args.itervalues(): @@ -149,7 +149,7 @@ def texi_members(doc, member_func, show_undocumented): items +=3D member_func(section.member) + texi_format(desc) + '\n' if not items: return '' - return '@table @asis\n' + items + '@end table\n' + return '\n@b{%s:}\n@table @asis\n%s@end table\n' % (what, items) =20 =20 def texi_sections(doc): @@ -169,9 +169,10 @@ def texi_sections(doc): return body =20 =20 -def texi_entity(doc, member_func=3Dtexi_member, show_undocumented=3DFalse): +def texi_entity(doc, what, member_func=3Dtexi_member, + show_undocumented=3DFalse): return (texi_body(doc) - + texi_members(doc, member_func, show_undocumented) + + texi_members(doc, what, member_func, show_undocumented) + texi_sections(doc)) =20 =20 @@ -189,7 +190,7 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): self.out +=3D '\n' self.out +=3D TYPE_FMT(type=3D'Enum', name=3Ddoc.symbol, - body=3Dtexi_entity(doc, + body=3Dtexi_entity(doc, 'Values', member_func=3Dtexi_enum_valu= e, show_undocumented=3DTrue)) =20 @@ -205,7 +206,7 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): self.out +=3D '\n' self.out +=3D TYPE_FMT(type=3Dtyp, name=3Ddoc.symbol, - body=3Dtexi_entity(doc)) + body=3Dtexi_entity(doc, 'Members')) =20 def visit_alternate_type(self, name, info, variants): doc =3D self.cur_doc @@ -213,7 +214,7 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): self.out +=3D '\n' self.out +=3D TYPE_FMT(type=3D'Alternate', name=3Ddoc.symbol, - body=3Dtexi_entity(doc)) + body=3Dtexi_entity(doc, 'Members')) =20 def visit_command(self, name, info, arg_type, ret_type, gen, success_response, boxed): @@ -222,7 +223,7 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): self.out +=3D '\n' self.out +=3D MSG_FMT(type=3D'Command', name=3Ddoc.symbol, - body=3Dtexi_entity(doc)) + body=3Dtexi_entity(doc, 'Arguments')) =20 def visit_event(self, name, info, arg_type, boxed): doc =3D self.cur_doc @@ -230,7 +231,7 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): self.out +=3D '\n' self.out +=3D MSG_FMT(type=3D'Event', name=3Ddoc.symbol, - body=3Dtexi_entity(doc)) + body=3Dtexi_entity(doc, 'Arguments')) =20 def symbol(self, doc, entity): self.cur_doc =3D doc --=20 2.7.4