From nobody Mon Apr 29 17:28:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573643053; cv=none; d=zoho.com; s=zohoarc; b=TRf2ZRmwSvZhIX5tMxF0GlXAzXUsqyHx+UcpILw3YkREWC8e1B85BGAWLhYdSk/svlSxz6laswbIMlYU0VSr2XP6tL863OaLRiAQFRpGjWSby7syxH9s4L/jXeu/9ETKCKWMjMVqFrbEYc1JdzDYNj+UOjjboW1gs75WIC0xT4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573643053; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=eRQy7zpJVOhw7+3AIDxh8O6XUj28KUEDfzxG/wp4dFM=; b=b1/9ATMJ0RYVvb5eqL7JHU+Az9rhimCWQ3UIbnqV7j2rfJ6udATS3soea+7xMQKRjm0Fz43KBIvWkM5SwhoaeZfPLgutp5Ch3ekXJj6wKqFYKvamoh5bfoQ7IMutc6lqmbpUSlT/mtP8TIf/aMqUMv7F4ROCz4Q/8ulVAar4PYs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1573643053891323.5300722232289; Wed, 13 Nov 2019 03:04:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-148-7n0cNxgSP1COUSydqNlF5g-1; Wed, 13 Nov 2019 06:04:11 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A808418B9FA5; Wed, 13 Nov 2019 11:04:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59B1A4D75D; Wed, 13 Nov 2019 11:04:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4128A1808855; Wed, 13 Nov 2019 11:04:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xADB42Kc030834 for ; Wed, 13 Nov 2019 06:04:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6B9292B7C5; Wed, 13 Nov 2019 11:04:02 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.43.2.246]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4C6B17F22; Wed, 13 Nov 2019 11:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573643052; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eRQy7zpJVOhw7+3AIDxh8O6XUj28KUEDfzxG/wp4dFM=; b=hh7no4V84Gi+LUz7n5w1uf1Qd0pbZBsQbLL9ZMPTMgR+XIoZ1mYvLD7Ac0YBgJ/uAfAVTr UoROelQXebqcl5kZ+Qt/gxJ0QaLj11pwahknKMd9JbWb5oKevbUhVX6mUMfa4L0osQV49t CYnfsqO6+50iR+DLYPeAHOs/UJr67d4= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 13 Nov 2019 12:03:56 +0100 Message-Id: <20191113110356.215434-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: sahid.ferdjaoui@canonical.com Subject: [libvirt] [rust PATCH] api_tests.py: Fix all issues reported by flake8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 7n0cNxgSP1COUSydqNlF5g-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: Erik Skultety --- tools/api_tests.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/api_tests.py b/tools/api_tests.py index 9e66c92..7f0e3cb 100644 --- a/tools/api_tests.py +++ b/tools/api_tests.py @@ -6,36 +6,39 @@ import xml.etree.ElementTree import sys =20 =20 -LIBVIRT_API_FILE=3D"/usr/share/libvirt/api/libvirt-api.xml" +LIBVIRT_API_FILE =3D "/usr/share/libvirt/api/libvirt-api.xml" MY_PATH =3D os.path.dirname(os.path.realpath(__file__)) SRC_PATH =3D MY_PATH + "/../src" =20 + def get_api_symbols(doc): funcs =3D doc.iter('function') macros =3D doc.iter('macro') enums =3D doc.iter('enum') return funcs, macros, enums =20 + def get_sources(): return glob.glob(SRC_PATH + "/*.rs") =20 + def match(el, content): return content.find(el) >=3D 0 =20 + def main(): filter_by =3D "" if len(sys.argv) > 1: filter_by =3D sys.argv[1] - =20 + doc =3D xml.etree.ElementTree.parse(LIBVIRT_API_FILE).getroot() =20 implemented =3D set([]) missing =3D set([]) for el in doc.iter('function'): =20 - =20 - if el.get('name').startswith(filter_by): # What i'm looking for? - =20 + if el.get('name').startswith(filter_by): # What I'm looking for + status =3D False for source in get_sources(): f =3D open(source) @@ -51,13 +54,10 @@ def main(): print("missing:") for x in missing: print(x.attrib) - #print "implemented:" - #for x in implemented: - # print x.attrib - =20 + # print "implemented:" + # for x in implemented: + # print x.attrib + =20 if __name__ =3D=3D '__main__': main() - =20 - =20 - =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list