diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-03-22 15:41:48 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-03-22 19:41:03 +0000 |
commit | 570cc14c50782ed46393a0a6a8d9d491fbb3785a (patch) | |
tree | 9b123ff862fb83b2c70db4791792919ecc59bd47 /examples/widgets/tutorials/cannon | |
parent | 80aec29aca246f1f67a4f8c453b49f1eadfee6fd (diff) |
Replace % formatting in examples by f-strings
As drive-by, Fix fortune server, addressbook and dombookmarks examples to work.
Task-number: PYSIDE-1112
Change-Id: I8ef7759ed56aeb7157cf2222bee9b6481973112a
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/widgets/tutorials/cannon')
-rw-r--r-- | examples/widgets/tutorials/cannon/t10.py | 4 | ||||
-rw-r--r-- | examples/widgets/tutorials/cannon/t11.py | 4 | ||||
-rw-r--r-- | examples/widgets/tutorials/cannon/t12.py | 4 | ||||
-rw-r--r-- | examples/widgets/tutorials/cannon/t13.py | 4 | ||||
-rw-r--r-- | examples/widgets/tutorials/cannon/t14.py | 4 | ||||
-rw-r--r-- | examples/widgets/tutorials/cannon/t8.py | 6 | ||||
-rw-r--r-- | examples/widgets/tutorials/cannon/t9.py | 4 |
7 files changed, 15 insertions, 15 deletions
diff --git a/examples/widgets/tutorials/cannon/t10.py b/examples/widgets/tutorials/cannon/t10.py index ca7e9d9b7..1cfed53aa 100644 --- a/examples/widgets/tutorials/cannon/t10.py +++ b/examples/widgets/tutorials/cannon/t10.py @@ -77,9 +77,9 @@ class LCDRange(QtWidgets.QWidget): def setRange(self, minValue, maxValue): if minValue < 0 or maxValue > 99 or minValue > maxValue: - QtCore.qWarning("LCDRange::setRange(%d, %d)\n" + QtCore.qWarning(f"LCDRange::setRange({minValue}, {maxValue})\n" "\tRange must be 0..99\n" - "\tand minValue must not be greater than maxValue" % (minValue, maxValue)) + "\tand minValue must not be greater than maxValue") return self.slider.setRange(minValue, maxValue) diff --git a/examples/widgets/tutorials/cannon/t11.py b/examples/widgets/tutorials/cannon/t11.py index c3d2e1271..dfc206d51 100644 --- a/examples/widgets/tutorials/cannon/t11.py +++ b/examples/widgets/tutorials/cannon/t11.py @@ -78,9 +78,9 @@ class LCDRange(QtWidgets.QWidget): def setRange(self, minValue, maxValue): if minValue < 0 or maxValue > 99 or minValue > maxValue: - QtCore.qWarning("LCDRange::setRange(%d, %d)\n" + QtCore.qWarning(f"LCDRange::setRange({minValue}, {maxValue})\n" "\tRange must be 0..99\n" - "\tand minValue must not be greater than maxValue" % (minValue, maxValue)) + "\tand minValue must not be greater than maxValue") return self.slider.setRange(minValue, maxValue) diff --git a/examples/widgets/tutorials/cannon/t12.py b/examples/widgets/tutorials/cannon/t12.py index 290ecc82e..b94a28688 100644 --- a/examples/widgets/tutorials/cannon/t12.py +++ b/examples/widgets/tutorials/cannon/t12.py @@ -95,9 +95,9 @@ class LCDRange(QtWidgets.QWidget): def setRange(self, minValue, maxValue): if minValue < 0 or maxValue > 99 or minValue > maxValue: - QtCore.qWarning("LCDRange::setRange(%d, %d)\n" + QtCore.qWarning(f"LCDRange::setRange({minValue}, {maxValue})\n" "\tRange must be 0..99\n" - "\tand minValue must not be greater than maxValue" % (minValue, maxValue)) + "\tand minValue must not be greater than maxValue") return self.slider.setRange(minValue, maxValue) diff --git a/examples/widgets/tutorials/cannon/t13.py b/examples/widgets/tutorials/cannon/t13.py index b54945e25..467346c2c 100644 --- a/examples/widgets/tutorials/cannon/t13.py +++ b/examples/widgets/tutorials/cannon/t13.py @@ -96,9 +96,9 @@ class LCDRange(QtWidgets.QWidget): def setRange(self, minValue, maxValue): if minValue < 0 or maxValue > 99 or minValue > maxValue: - QtCore.qWarning("LCDRange::setRange(%d, %d)\n" + QtCore.qWarning(f"LCDRange::setRange({minValue}, {maxValue})\n" "\tRange must be 0..99\n" - "\tand minValue must not be greater than maxValue" % (minValue, maxValue)) + "\tand minValue must not be greater than maxValue") return self.slider.setRange(minValue, maxValue) diff --git a/examples/widgets/tutorials/cannon/t14.py b/examples/widgets/tutorials/cannon/t14.py index 19fb95ac8..420eeaa08 100644 --- a/examples/widgets/tutorials/cannon/t14.py +++ b/examples/widgets/tutorials/cannon/t14.py @@ -96,9 +96,9 @@ class LCDRange(QtWidgets.QWidget): def setRange(self, minValue, maxValue): if minValue < 0 or maxValue > 99 or minValue > maxValue: - QtCore.qWarning("LCDRange::setRange(%d, %d)\n" + QtCore.qWarning(f"LCDRange::setRange({minValue}, {maxValue})\n" "\tRange must be 0..99\n" - "\tand minValue must not be greater than maxValue" % (minValue, maxValue)) + "\tand minValue must not be greater than maxValue") return self.slider.setRange(minValue, maxValue) diff --git a/examples/widgets/tutorials/cannon/t8.py b/examples/widgets/tutorials/cannon/t8.py index 3761b4353..e2d013eca 100644 --- a/examples/widgets/tutorials/cannon/t8.py +++ b/examples/widgets/tutorials/cannon/t8.py @@ -77,9 +77,9 @@ class LCDRange(QtWidgets.QWidget): def setRange(self, minValue, maxValue): if minValue < 0 or maxValue > 99 or minValue > maxValue: - QtCore.qWarning("LCDRange.setRange(%d, %d)\n" + QtCore.qWarning("LCDRange.setRange({minValue}, {maxValue})\n" "\tRange must be 0..99\n" - "\tand minValue must not be greater than maxValue" % (minValue, maxValue)) + "\tand minValue must not be greater than maxValue") return self.slider.setRange(minValue, maxValue) @@ -111,7 +111,7 @@ class CannonField(QtWidgets.QWidget): def paintEvent(self, event): painter = QtGui.QPainter(self) - painter.drawText(200, 200, "Angle = %d" % self.currentAngle) + painter.drawText(200, 200, f"Angle = {self.currentAngle}") class MyWidget(QtWidgets.QWidget): diff --git a/examples/widgets/tutorials/cannon/t9.py b/examples/widgets/tutorials/cannon/t9.py index ca949c1ac..6d743357d 100644 --- a/examples/widgets/tutorials/cannon/t9.py +++ b/examples/widgets/tutorials/cannon/t9.py @@ -77,9 +77,9 @@ class LCDRange(QtWidgets.QWidget): def setRange(self, minValue, maxValue): if minValue < 0 or maxValue > 99 or minValue > maxValue: - QtCore.qWarning("LCDRange::setRange(%d, %d)\n" + QtCore.qWarning(f"LCDRange::setRange({minValue}, {maxValue})\n" "\tRange must be 0..99\n" - "\tand minValue must not be greater than maxValue" % (minValue, maxValue)) + "\tand minValue must not be greater than maxValue") return self.slider.setRange(minValue, maxValue) |