From nobody Thu Dec 5 01:40:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1732311403475890.4814395205336; Fri, 22 Nov 2024 13:36:43 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id DB9381BF6; Fri, 22 Nov 2024 16:36:42 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B0EF71646; Fri, 22 Nov 2024 16:34:01 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 462F3161F; Fri, 22 Nov 2024 16:33:56 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 0F6A5163D for ; Fri, 22 Nov 2024 16:33:31 -0500 (EST) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-244-DoozHoh6PnWkkDx17oGNIg-1; Fri, 22 Nov 2024 16:33:28 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 08ABF19560B0 for ; Fri, 22 Nov 2024 21:33:28 +0000 (UTC) Received: from orkuz (unknown [10.45.224.26]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 810571955F57 for ; Fri, 22 Nov 2024 21:33:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732311210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eK7Zw5AVK4Vj1+ivvUPzuIYpu9f6GDrat8eNjJmhQOE=; b=IGns4LrCilPnyXcvjLgtp69BT3R6X8G35xvtZzPeiE8LSUWR0Wd9ZV2AQ8ae9Xg22D4y2P isjPO3qSas9uaNGS/Updf5QNOoNFmSsua5BXhRYZFAYT3JLYcTysSEjEkZ6V/2rNefPiP2 /j2vYWuvo/owuU+EdppQf/T9XjKRCKE= X-MC-Unique: DoozHoh6PnWkkDx17oGNIg-1 X-Mimecast-MFC-AGG-ID: DoozHoh6PnWkkDx17oGNIg From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH v2 04/36] sync_qemu_models_i386: Use f-strings Date: Fri, 22 Nov 2024 22:32:44 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: NOpQQJYuPe4mvKKbmdZFGmfDkYdTfNGCngzq9hlTO3k_1732311208 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: KU3XGCNJZMYX27NXAUNT7XZQGXPV6SJV X-Message-ID-Hash: KU3XGCNJZMYX27NXAUNT7XZQGXPV6SJV X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1732311405837116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Daniel P. Berrang=C3=A9 --- Notes: Version 2: - no change src/cpu_map/sync_qemu_models_i386.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/cpu_map/sync_qemu_models_i386.py b/src/cpu_map/sync_qemu_m= odels_i386.py index 65ae031223..78c2bffab2 100755 --- a/src/cpu_map/sync_qemu_models_i386.py +++ b/src/cpu_map/sync_qemu_models_i386.py @@ -19,7 +19,7 @@ def translate_vendor(name): if name in T: return T[name] =20 - print("warning: Unknown vendor '{}'".format(name)) + print(f"warning: Unknown vendor '{name}'") return name =20 =20 @@ -318,7 +318,7 @@ def translate_feature(name): if name.replace("-", "_") =3D=3D v.replace("-", "_"): return v =20 - print("warning: Unknown feature '{}'".format(name)) + print(f"warning: Unknown feature '{name}'") return name =20 =20 @@ -484,17 +484,16 @@ def output_model(f, model): if model["extra"]: f.write("\n") =20 f.write("\n") - f.write(" \n".format(model["name"])) + f.write(f" \n") f.write(" \n") - f.write(" \n".format( - model["family"], model["model"])) - f.write(" \n".format(model["vendor"])) + f.write(f" \n") + f.write(f" \n") for feature in sorted(model["features"]): - f.write(" \n".format(feature)) + f.write(f" \n") f.write(" \n") f.write("\n") =20 @@ -535,7 +534,7 @@ def main(): models.extend(expand_model(model)) =20 for model in models: - name =3D os.path.join(args.outdir, "x86_{}.xml".format(model["name= "])) + name =3D os.path.join(args.outdir, f"x86_{model['name']}.xml") with open(name, "wt") as f: output_model(f, model) =20 @@ -550,10 +549,10 @@ def main(): unknown =3D [x for x in features if x not in known and x is not No= ne] except Exception as e: unknown =3D [] - print("warning: Unable to read libvirt x86_features.xml: {}".forma= t(e)) + print(f"warning: Unable to read libvirt x86_features.xml: {e}") =20 for x in unknown: - print("warning: Feature unknown to libvirt: {}".format(x)) + print(f"warning: Feature unknown to libvirt: {x}") =20 =20 if __name__ =3D=3D "__main__": --=20 2.47.0