[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/14] qapi/doc.py: Remove one-letter variables
From: |
John Snow |
Subject: |
[PATCH 09/14] qapi/doc.py: Remove one-letter variables |
Date: |
Tue, 22 Sep 2020 17:17:57 -0400 |
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/doc.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
index 74d017f60e..5f2b0cd51d 100644
--- a/scripts/qapi/doc.py
+++ b/scripts/qapi/doc.py
@@ -203,17 +203,17 @@ def texi_members(doc: QAPIDoc,
items += texi_member(section.member, desc, '')
if base:
items += '@item The members of @code{%s}\n' % base.doc_type()
- if variants:
- for v in variants.variants:
- when = ' when @code{%s} is @t{"%s"}%s' % (
- variants.tag_member.name, v.name, texi_if(v.ifcond, " (", ")"))
- if v.type.is_implicit():
- assert not v.type.base and not v.type.variants
- for m in v.type.local_members:
- items += texi_member(m, '', when)
- else:
- items += '@item The members of @code{%s}%s\n' % (
- v.type.doc_type(), when)
+ for variant in variants.variants if variants else ():
+ when = ' when @code{%s} is @t{"%s"}%s' % (
+ variants.tag_member.name, variant.name,
+ texi_if(variant.ifcond, " (", ")"))
+ if variant.type.is_implicit():
+ assert not variant.type.base and not variant.type.variants
+ for member in variant.type.local_members:
+ items += texi_member(member, '', when)
+ else:
+ items += '@item The members of @code{%s}%s\n' % (
+ variant.type.doc_type(), when)
if not items:
return ''
return '\n@b{%s:}\n@table @asis\n%s@end table\n' % (what, items)
--
2.26.2
- [PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen property, (continued)
- [PATCH 11/14] qapi/doc.py: Don't use private attributes of QAPIGen property, John Snow, 2020/09/22
- [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 <=
- [PATCH 08/14] qapi/doc.py: Add generic texi_member callback, John Snow, 2020/09/22
- Re: [PATCH 00/14] qapi: static typing conversion, pt3, John Snow, 2020/09/30