From patchwork Mon Oct 2 14:13:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 820532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y5Pd21sJSz9t6n for ; Tue, 3 Oct 2017 01:27:18 +1100 (AEDT) Received: from localhost ([::1]:52566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz1gi-0000ZV-Bk for incoming@patchwork.ozlabs.org; Mon, 02 Oct 2017 10:27:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz1Tk-00070B-Dx for qemu-devel@nongnu.org; Mon, 02 Oct 2017 10:13:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dz1Tj-0003eH-BY for qemu-devel@nongnu.org; Mon, 02 Oct 2017 10:13:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dz1Tj-0003dq-5e for qemu-devel@nongnu.org; Mon, 02 Oct 2017 10:13:51 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 562925275A for ; Mon, 2 Oct 2017 14:13:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 562925275A Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=armbru@redhat.com Received: from blackfin.pond.sub.org (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E27519520A; Mon, 2 Oct 2017 14:13:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EFFF6115627A; Mon, 2 Oct 2017 16:13:41 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 2 Oct 2017 16:13:41 +0200 Message-Id: <20171002141341.24616-12-armbru@redhat.com> In-Reply-To: <20171002141341.24616-1-armbru@redhat.com> References: <20171002141341.24616-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 02 Oct 2017 14:13:50 +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 11/11] qapi2texi: De-duplicate code to add blank line before symbol X-BeenThere: qemu-devel@gnu.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 Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org Sender: "Qemu-devel" Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau --- scripts/qapi2texi.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index 58add26c11..92e2af2cd6 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -206,8 +206,6 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): def visit_enum_type(self, name, info, values, prefix): doc = self.cur_doc - if self.out: - self.out += '\n' self.out += TYPE_FMT(type='Enum', name=doc.symbol, body=texi_entity(doc, 'Values', @@ -217,16 +215,12 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): doc = self.cur_doc if base and base.is_implicit(): base = None - if self.out: - self.out += '\n' self.out += TYPE_FMT(type='Object', name=doc.symbol, body=texi_entity(doc, 'Members', base, variants)) def visit_alternate_type(self, name, info, variants): doc = self.cur_doc - if self.out: - self.out += '\n' self.out += TYPE_FMT(type='Alternate', name=doc.symbol, body=texi_entity(doc, 'Members')) @@ -234,8 +228,6 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): def visit_command(self, name, info, arg_type, ret_type, gen, success_response, boxed): doc = self.cur_doc - if self.out: - self.out += '\n' if boxed: body = texi_body(doc) body += ('\n@b{Arguments:} the members of @code{%s}\n' @@ -249,13 +241,13 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor): def visit_event(self, name, info, arg_type, boxed): doc = self.cur_doc - if self.out: - self.out += '\n' self.out += MSG_FMT(type='Event', name=doc.symbol, body=texi_entity(doc, 'Arguments')) def symbol(self, doc, entity): + if self.out: + self.out += '\n' self.cur_doc = doc entity.visit(self) self.cur_doc = None