[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for 2.9 30/49] qapi2texi: Generate descriptions for s
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL for 2.9 30/49] qapi2texi: Generate descriptions for simple union tags |
Date: |
Thu, 16 Mar 2017 07:27:46 +0100 |
Simple union tags carry no type information, because their type is
implicit. Their description should make up for it, but many have
none. Generate one automatically then.
Example change (qemu-qmp-ref.txt):
-- Simple Union: ImageInfoSpecific
A discriminated record of image format specific information
structures.
Members:
'type'
- Not documented
+ One of "qcow2", "vmdk", "luks"
'data: ImageInfoSpecificQCow2' when 'type' is "qcow2"
'data: ImageInfoSpecificVmdk' when 'type' is "vmdk"
'data: QCryptoBlockInfoLUKS' when 'type' is "luks"
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
---
scripts/qapi2texi.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index ab6b6cd..282adf4 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -148,11 +148,16 @@ def texi_members(doc, what, base, variants, member_func):
"""Format the table of members"""
items = ''
for section in doc.args.itervalues():
+ # TODO Drop fallbacks when undocumented members are outlawed
if section.content:
- desc = str(section)
+ desc = texi_format(str(section))
+ elif (variants and variants.tag_member == section.member
+ and not section.member.type.doc_type()):
+ values = section.member.type.member_names()
+ desc = 'One of ' + ', '.join(['@t{"%s"}' % v for v in values])
else:
desc = 'Not documented'
- items += member_func(section.member) + texi_format(desc) + '\n'
+ items += member_func(section.member) + desc + '\n'
if base:
items += '@item The members of @code{%s}\n' % base.doc_type()
if variants:
--
2.7.4
- [Qemu-devel] [PULL for 2.9 40/49] qapi: Eliminate check_docs() and drop QAPIDoc.expr, (continued)
- [Qemu-devel] [PULL for 2.9 40/49] qapi: Eliminate check_docs() and drop QAPIDoc.expr, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 39/49] qapi: Fix detection of bogus member documentation, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 32/49] tests/qapi-schema: Improve doc / expression mismatch coverage, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 21/49] qapi: Prefer single-quoted strings more consistently, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 29/49] qapi2texi: Generate documentation for variant members, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 18/49] qapi2texi: Convert to QAPISchemaVisitor, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 48/49] qapi: Make pylint a bit happier, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 15/49] qapi: Fix QAPISchemaEnumType.is_implicit() for 'QType', Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 13/49] qapi: Avoid unwanted blank lines in QAPIDoc, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 25/49] qapi2texi: Don't hide undocumented members and arguments, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 30/49] qapi2texi: Generate descriptions for simple union tags,
Markus Armbruster <=
- [Qemu-devel] [PULL for 2.9 41/49] qapi: Drop unused variable events, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 31/49] qapi2texi: Use category "Object" for all object types, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 35/49] qapi: Improve error message on @NAME: in free-form doc, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 22/49] qapi2texi: Plainer enum value and member name formatting, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 33/49] qapi: Fix detection of doc / expression mismatch, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 23/49] qapi2texi: Present the table of members more clearly, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 36/49] qapi: Move empty doc section checking to doc parser, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 42/49] qapi: Simplify what gets stored in enum_types, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 34/49] qapi: Move detection of doc / expression name mismatch, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 46/49] qapi: union_types is a list used like a dict, make it one, Markus Armbruster, 2017/03/16