linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anubhav Shelat <ashelat@redhat.com>
To: linux-rt-users@vger.kernel.org
Cc: Anubhav Shelat <ashelat@redhat.com>
Subject: [PATCH v2 10/10] rteval: Use f-strings in __init__.py
Date: Thu,  1 Jun 2023 16:27:36 -0400	[thread overview]
Message-ID: <20230601202734.813515-11-ashelat@redhat.com> (raw)
In-Reply-To: <20230601202734.813515-1-ashelat@redhat.com>

Use f-strings in __init__.py

Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
---
 rteval/sysinfo/__init__.py | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/rteval/sysinfo/__init__.py b/rteval/sysinfo/__init__.py
index 5767e5b7f6fe..31059c564d59 100644
--- a/rteval/sysinfo/__init__.py
+++ b/rteval/sysinfo/__init__.py
@@ -83,27 +83,23 @@ if __name__ == "__main__":
 
     print(f"\tRunning on {si.get_base_os()}")
     print(f"\tNUMA nodes: {si.mem_get_numa_nodes()}")
-    print("\tMemory available: %03.2f %s\n" % si.mem_get_size())
+    print(f"\tMemory available: {si.mem_get_size()[0]:03.2f} {si.mem_get_size()[1]}\n")
 
     print("\tServices: ")
     for (s, r) in list(si.services_get().items()):
-        print("\t\t%s: %s" % (s, r))
+        print(f"\t\t{s}: {r}")
     (curr, avail) = si.kernel_get_clocksources()
 
-    print("\tCurrent clocksource: %s" % curr)
-    print("\tAvailable clocksources: %s" % avail)
+    print(f"\tCurrent clocksource: {curr}")
+    print(f"\tAvailable clocksources: {avail}")
     print("\tModules:")
     for m in si.kernel_get_modules():
-        print("\t\t%s: %s" % (m['modname'], m['modstate']))
+        print(f"\t\t{m['modname']}: {m['modstate']}")
     print("\tKernel threads:")
     for (p, i) in list(si.kernel_get_kthreads().items()):
-        print("\t\t%-30.30s pid: %-5.5s policy: %-7.7s prio: %-3.3s" % (
-            str(i["name"])+":", p, i["policy"], i["priority"]
-            ))
+        print(f"\t\t{str(i['name'])[:30]+':':<30} pid: {str(p)[:5]:<5} policy: {str(i['policy'])[:7]:<7} prio: {str(i['priority'])[:3]:<3}")
 
-    print("\n\tCPU topology info - cores: %i  online: %i  sockets: %i" % (
-        si.cpu_getCores(False), si.cpu_getCores(True), si.cpu_getSockets()
-        ))
+    print(f"\n\tCPU topology info - cores: {si.cpu_getCores(False)}  online: {si.cpu_getCores(True)}  sockets: {si.cpu_getSockets()}")
 
     xml = si.MakeReport()
     xml_d = libxml2.newDoc("1.0")
-- 
2.31.1


      parent reply	other threads:[~2023-06-01 20:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 20:27 [PATCH v2 00/10] Cover Letter Anubhav Shelat
2023-06-01 20:27 ` [PATCH v2 01/10] rteval: Use f-strings in rtevalclient.py Anubhav Shelat
2023-06-05 19:28   ` John Kacur
2023-06-01 20:27 ` [PATCH v2 02/10] rteval: Use f-strings in rtevalConfig Anubhav Shelat
2023-06-05 19:31   ` John Kacur
2023-06-01 20:27 ` [PATCH v2 03/10] rteval: Use f-strings in cputopology Anubhav Shelat
2023-06-12 18:32   ` John Kacur
2023-06-01 20:27 ` [PATCH v2 04/10] rteval: Use f-strings in kernel.py Anubhav Shelat
2023-06-12 18:35   ` John Kacur
2023-06-01 20:27 ` [PATCH v2 05/10] rteval: Use f-strings in memory.py Anubhav Shelat
2023-06-12 18:39   ` John Kacur
2023-06-01 20:27 ` [PATCH v2 06/10] rteval: Use f-strings in osinfo Anubhav Shelat
2023-06-12 18:50   ` John Kacur
2023-06-01 20:27 ` [PATCH v2 07/10] rteval: Use f-strings in services.py Anubhav Shelat
2023-06-12 18:58   ` John Kacur
2023-06-01 20:27 ` [PATCH v2 08/10] rteval: Use f-strings in tools.py Anubhav Shelat
2023-06-12 18:59   ` John Kacur
2023-06-01 20:27 ` [PATCH v2 09/10] Added code to check if the proc/net/if_inet6 file exists while loading IPv6 addresses in the IPv6Addresses class Anubhav Shelat
2023-06-06 15:22   ` John Kacur
2023-06-01 20:27 ` Anubhav Shelat [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230601202734.813515-11-ashelat@redhat.com \
    --to=ashelat@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).