Manually convert most remaining format statements

%d accepts floats and other things, so manual fixes are needed after
conversion.

After flynt -ll 2000 --aggressive, each was manually checked if the
casts with int() are needed.

Two statements are still missing in ls370res

Change-Id: I2651ddbe60695aa19582882a97d0f71bcb05c1ef
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/30901
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Alexander Zaft
2023-04-14 09:43:08 +02:00
parent 32b6d6ffc2
commit 0bf4b6cdf2
15 changed files with 58 additions and 64 deletions

View File

@@ -94,7 +94,7 @@ class TCPRequestHandler(socketserver.BaseRequestHandler):
if origin in (HELP, b''): # empty string -> send help message
for idx, line in enumerate(HelpMessage.splitlines()):
# not sending HELPREPLY here, as there should be only one reply for every request
self.send_reply(('_', '%d' % (idx+1), line))
self.send_reply(('_', f'{idx + 1}', line))
# ident matches request
self.send_reply((HELPREPLY, None, None))
continue
@@ -181,7 +181,7 @@ class TCPServer(socketserver.ThreadingTCPServer):
# for cfg-editor
configurables = {
'uri': Property('hostname or ip address for binding', StringType(),
default='tcp://%d' % DEF_PORT, export=False),
default=f'tcp://{DEF_PORT}', export=False),
'detailed_errors': Property('Flag to enable detailed Errorreporting.', BoolType(),
default=False, export=False),
}

View File

@@ -97,7 +97,7 @@ class Router(frappy.protocol.dispatcher.Dispatcher):
self.nodes = [SecopClient(uri, logger.getChild('routed'), self)]
self.singlenode = self.nodes[0]
else:
self.nodes = [SecopClient(uri, logger.getChild('routed%d' % i), self) for i, uri in enumerate(uris)]
self.nodes = [SecopClient(uri, logger.getChild(f'routed{i}'), self) for i, uri in enumerate(uris)]
# register callbacks
for node in self.nodes:
node.register_callback(None, node.updateEvent, node.descriptiveDataChange, node.nodeStateChange)