From nobody Wed Dec 4 19:03:36 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 1732042385427432.94340181591235; Tue, 19 Nov 2024 10:53:05 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 61BBC1445; Tue, 19 Nov 2024 13:53:04 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 77008146F; Tue, 19 Nov 2024 13:50:34 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id D4B0813DD; Tue, 19 Nov 2024 13:50:21 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 5258C13DB for ; Tue, 19 Nov 2024 13:50:21 -0500 (EST) Received: from mx-prod-mc-01.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-407-moiMyhSrMFCJ2uvfet3WXQ-1; Tue, 19 Nov 2024 13:50:19 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A4EC51956077 for ; Tue, 19 Nov 2024 18:50:18 +0000 (UTC) Received: from orkuz (unknown [10.45.226.13]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2A39A19560A3 for ; Tue, 19 Nov 2024 18:50:17 +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_H2,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=1732042221; 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=j0bAEkGapVP0SM0q3FfoeSBRIpc61EplrSDA2wNiPU0=; b=UOIuFtzBUQ/SlgoNdLD4Lr0zfUc8CW0XJPtlPDx+umEQvmzNvX6OwRwhS6M+gwE97gHGxX RfIY3JfegcznqZ/1Egg7PuoMhA3SASsYKlovss4FG23rU9r0ttYwCOpEd6bD5veY7E+M9i +G783JnTByYHhUO+KMrLJ3d04hNjwUU= X-MC-Unique: moiMyhSrMFCJ2uvfet3WXQ-1 X-Mimecast-MFC-AGG-ID: moiMyhSrMFCJ2uvfet3WXQ From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH 03/32] sync_qemu_models_i386: Use f-strings Date: Tue, 19 Nov 2024 19:49:39 +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: NGDLtWYAsPKpV36gXzgGGjSJ7n0BDVym-ROnEL44jzA_1732042218 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WZWFG25HWX5DDEC7EQYQQ6BWJEQI4LZW X-Message-ID-Hash: WZWFG25HWX5DDEC7EQYQQ6BWJEQI4LZW 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: 1732042387547116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Daniel P. Berrang=C3=A9 --- 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