From d68951ac245150eeefa6e0f4156e4c1b5c9e9325 Mon Sep 17 00:00:00 2001 From: Jan Gelety Date: Tue, 12 Nov 2019 05:27:43 +0100 Subject: Python3: resources and libraries Change-Id: I1392c06b1d64f62b141d24c0d42a8e36913b15e2 Signed-off-by: Jan Gelety --- .../libraries/python/MLRsearch/ReceiveRateMeasurement.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py') diff --git a/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py b/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py index d052ebd3bf..31a6f8202e 100644 --- a/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py +++ b/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Cisco and/or its affiliates. +# Copyright (c) 2019 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -14,7 +14,7 @@ """Module defining ReceiveRateMeasurement class.""" -class ReceiveRateMeasurement(object): +class ReceiveRateMeasurement: """Structure defining the result of single Rr measurement.""" def __init__(self, duration, target_tr, transmit_count, loss_count): @@ -43,12 +43,12 @@ class ReceiveRateMeasurement(object): def __str__(self): """Return string reporting input and loss fraction.""" - return "d={dur!s},Tr={rate!s},Df={frac!s}".format( - dur=self.duration, rate=self.target_tr, frac=self.loss_fraction) + return f"d={self.duration!s},Tr={self.target_tr!s}," \ + f"Df={self.loss_fraction!s}" def __repr__(self): """Return string evaluable as a constructor call.""" - return ("ReceiveRateMeasurement(duration={dur!r},target_tr={rate!r}" - ",transmit_count={trans!r},loss_count={loss!r})".format( - dur=self.duration, rate=self.target_tr, - trans=self.transmit_count, loss=self.loss_count)) + return f"ReceiveRateMeasurement(duration={self.duration!r}," \ + f"target_tr={self.target_tr!r}," \ + f"transmit_count={self.transmit_count!r}," \ + f"loss_count={self.loss_count!r})" -- cgit 1.2.3-korg