From: Marc-André Lureau Date: Mon, 5 Mar 2018 17:29:48 +0000 (+0100) Subject: qapi2texi: minor python code simplification X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=26ee12ad1f5fc1239b7366b696e813a27319b752;p=qemu.git qapi2texi: minor python code simplification Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster Message-Id: <20180305172951.2150-2-marcandre.lureau@redhat.com> Signed-off-by: Eric Blake --- diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py index 0ea68bf813..79d11bbe9b 100644 --- a/scripts/qapi/doc.py +++ b/scripts/qapi/doc.py @@ -134,10 +134,9 @@ def texi_enum_value(value): def texi_member(member, suffix=''): """Format a table of members item for an object type member""" typ = member.type.doc_type() - return '@item @code{%s%s%s}%s%s\n' % ( - member.name, - ': ' if typ else '', - typ if typ else '', + membertype = ': ' + typ if typ else '' + return '@item @code{%s%s}%s%s\n' % ( + member.name, membertype, ' (optional)' if member.optional else '', suffix)