diff mbox series

[v2,01/10] rteval: Use f-strings in rtevalclient.py

Message ID 20230601202734.813515-2-ashelat@redhat.com
State Superseded
Headers show
Series Cover Letter | expand

Commit Message

Anubhav Shelat June 1, 2023, 8:27 p.m. UTC
Use f-strings in rtevalclient.py

Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
---
 rteval/rtevalclient.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

John Kacur June 5, 2023, 7:28 p.m. UTC | #1
On Thu, 1 Jun 2023, Anubhav Shelat wrote:

> Use f-strings in rtevalclient.py
> 
> Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
> ---
>  rteval/rtevalclient.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rteval/rtevalclient.py b/rteval/rtevalclient.py
> index 26c953005326..7ff7d2700cfc 100644
> --- a/rteval/rtevalclient.py
> +++ b/rteval/rtevalclient.py
> @@ -61,7 +61,7 @@ class rtevalclient:
>          cmpr = compr.compress(fbuf.getvalue())
>          data = base64.b64encode(cmpr + compr.flush())
>          ret = self.srv.SendReport(self.hostname, data)
> -        print("rtevalclient::SendReport() - Sent %i bytes (XML document length: %i bytes, compression ratio: %.02f%%)" % (len(data), doclen, (1-(float(len(data)) / float(doclen)))*100 ))
> +        print(f"rtevalclient::SendReport() - Sent {len(data)} bytes (XML document length: {doclen} bytes, compression ratio: {(1-(float(len(data)) / float(doclen)))*100}:.2f)")
>          return ret
>  
>      def SendDataAsFile(self, fname, data, decompr = False):
> -- 

Signed-off-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

diff --git a/rteval/rtevalclient.py b/rteval/rtevalclient.py
index 26c953005326..7ff7d2700cfc 100644
--- a/rteval/rtevalclient.py
+++ b/rteval/rtevalclient.py
@@ -61,7 +61,7 @@  class rtevalclient:
         cmpr = compr.compress(fbuf.getvalue())
         data = base64.b64encode(cmpr + compr.flush())
         ret = self.srv.SendReport(self.hostname, data)
-        print("rtevalclient::SendReport() - Sent %i bytes (XML document length: %i bytes, compression ratio: %.02f%%)" % (len(data), doclen, (1-(float(len(data)) / float(doclen)))*100 ))
+        print(f"rtevalclient::SendReport() - Sent {len(data)} bytes (XML document length: {doclen} bytes, compression ratio: {(1-(float(len(data)) / float(doclen)))*100}:.2f)")
         return ret
 
     def SendDataAsFile(self, fname, data, decompr = False):