From patchwork Fri Aug 18 14:26:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?THVrw6HFoSBEb2t0b3I=?= X-Patchwork-Id: 9909269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C534860382 for ; Fri, 18 Aug 2017 14:34:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B026028C70 for ; Fri, 18 Aug 2017 14:34:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A503828CDF; Fri, 18 Aug 2017 14:34:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4F1ED28C70 for ; Fri, 18 Aug 2017 14:34:28 +0000 (UTC) Received: from localhost ([::1]:58020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diiLz-0005jx-Jy for patchwork-qemu-devel@patchwork.kernel.org; Fri, 18 Aug 2017 10:34:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diiF4-0000VW-Ds for qemu-devel@nongnu.org; Fri, 18 Aug 2017 10:27:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diiF3-0008FG-EF for qemu-devel@nongnu.org; Fri, 18 Aug 2017 10:27:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40480) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diiF3-0008Em-7V for qemu-devel@nongnu.org; Fri, 18 Aug 2017 10:27:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A79C883D2; Fri, 18 Aug 2017 14:27:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3A79C883D2 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=fail smtp.mailfrom=ldoktor@redhat.com Received: from localhost.localdomain.com (unknown [10.40.205.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 506FE66D81; Fri, 18 Aug 2017 14:27:12 +0000 (UTC) From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= To: qemu-devel@nongnu.org Date: Fri, 18 Aug 2017 16:26:10 +0200 Message-Id: <20170818142613.32394-8-ldoktor@redhat.com> In-Reply-To: <20170818142613.32394-1-ldoktor@redhat.com> References: <20170818142613.32394-1-ldoktor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 18 Aug 2017 14:27:16 +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 v6 07/10] qmp.py: Use object-based class for QEMUMonitorProtocol 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: ldoktor@redhat.com, famz@redhat.com, ehabkost@redhat.com, apahim@redhat.com, armbru@redhat.com, mreitz@redhat.com, jsnow@redhat.com, f4bug@amsat.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP There is no need to define QEMUMonitorProtocol as old-style class. Signed-off-by: Lukáš Doktor Reviewed-by: Eduardo Habkost --- scripts/qmp/qmp-shell | 4 ++-- scripts/qmp/qmp.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 860ffb2..be449de 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -106,7 +106,7 @@ class FuzzyJSON(ast.NodeTransformer): # _execute_cmd()). Let's design a better one. class QMPShell(qmp.QEMUMonitorProtocol): def __init__(self, address, pretty=False): - qmp.QEMUMonitorProtocol.__init__(self, self.__get_address(address)) + super(QMPShell, self).__init__(self.__get_address(address)) self._greeting = None self._completer = None self._pretty = pretty @@ -281,7 +281,7 @@ class QMPShell(qmp.QEMUMonitorProtocol): return True def connect(self, negotiate): - self._greeting = qmp.QEMUMonitorProtocol.connect(self, negotiate) + self._greeting = super(QMPShell, self).connect(negotiate) self.__completer_setup() def show_banner(self, msg='Welcome to the QMP low-level shell!'): diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py index 782d1ac..95ff5cc 100644 --- a/scripts/qmp/qmp.py +++ b/scripts/qmp/qmp.py @@ -30,7 +30,7 @@ class QMPTimeoutError(QMPError): pass -class QEMUMonitorProtocol: +class QEMUMonitorProtocol(object): #: Socket's error class error = socket.error