@@ -107,7 +107,7 @@ def updateFunc(self):
107107 self .gen .close ()
108108 self .sendComplete ("Download cancelled by the user" )
109109 else :
110- print ("WARNING: don't know what to do with cmd %s" % cmd )
110+ print (f "WARNING: don't know what to do with cmd { cmd } " )
111111 if self .parent .pmac is None or not self .parent .pmac .isConnectionOpen :
112112 time .sleep (0.1 )
113113 return
@@ -143,18 +143,15 @@ def updateFunc(self):
143143 if isinstance (self .parent .pmac , PmacSerialInterface ) and self .max_pollrate :
144144 if time .time () - self .parent .pmac .last_comm_time < 1.0 / self .max_pollrate :
145145 return
146- cmd = "i65???&%s ??%%" % self . CSNum
146+ cmd = f "i65???&{ self . CSNum } ??%"
147147 # Send a different command for the Power PMAC
148148 if isinstance (self .parent .pmac , PPmacSshInterface ):
149149 # The %% is because % needs escaping - only one % is actually sent
150150 # There has to be a space before the first BrickLV string to avoid its B being interpreted as a 'begin' command
151- cmd = (
152- "i65?&%s?%% BrickLV.BusUnderVoltage BrickLV.BusOverVoltage BrickLV.OverTemp"
153- % self .CSNum
154- )
151+ cmd = f"i65?&{ self .CSNum } ?% BrickLV.BusUnderVoltage BrickLV.BusOverVoltage BrickLV.OverTemp"
155152 elif isinstance (self .parent .pmac , PmacEthernetInterface ):
156153 # Add the 7 segment display status query
157- cmd = "i65???&%s ??%%" % self . CSNum
154+ cmd = f "i65???&{ self . CSNum } ??%"
158155 axes = self .parent .pmac .getNumberOfAxes () + 1
159156 for motorNo in range (1 , axes ):
160157 cmd = cmd + "#" + str (motorNo ) + "?PVF "
@@ -199,9 +196,7 @@ def updateFunc(self):
199196 # fourth is the PMAC identity
200197 if valueList [0 ].startswith ("\x07 " ):
201198 # error, probably in buffer
202- print (
203- "i65 returned %s, sending CLOSE command" % valueList [0 ].__repr__ ()
204- )
199+ print (f"i65 returned { valueList [0 ].__repr__ ()} , sending CLOSE command" )
205200 self .parent .pmac .sendCommand ("CLOSE" )
206201 return
207202
@@ -217,9 +212,9 @@ def updateFunc(self):
217212 # Global status
218213 self .resultQueue .put ([valueList [1 ], 0 , 0 , 0 , 0 , 0 , "G" ])
219214 # CS status
220- self .resultQueue .put ([valueList [2 ], 0 , 0 , 0 , 0 , 0 , "CS%s" % self .CSNum ])
215+ self .resultQueue .put ([valueList [2 ], 0 , 0 , 0 , 0 , 0 , f "CS{ self .CSNum } " ])
221216 # Fedrate
222- self .resultQueue .put ([valueList [3 ], 0 , 0 , 0 , 0 , 0 , "FEED%s" % self .CSNum ])
217+ self .resultQueue .put ([valueList [3 ], 0 , 0 , 0 , 0 , 0 , f "FEED{ self .CSNum } " ])
223218
224219 if isinstance (self .parent .pmac , PPmacSshInterface ):
225220 # Brick Under Voltage Status
@@ -241,5 +236,5 @@ def updateFunc(self):
241236 evUpdatesReady = CustomEvent (self .parent .updatesReadyEventType , None )
242237 QCoreApplication .postEvent (self .parent , evUpdatesReady )
243238 else :
244- print ('WARNING: Could not poll PMAC for motor status ("%s ")' % retStr )
239+ print (f 'WARNING: Could not poll PMAC for motor status ("{ retStr } ")' )
245240 time .sleep (0.1 )
0 commit comments