@@ -112,7 +112,7 @@ def get_dir(p):
112
112
for root in candidates :
113
113
root = Path (root ).resolve ()
114
114
if not root .exists ():
115
- raise pytest .UsageError ("rsyncdir doesn't exist: {!r}" . format ( root ) )
115
+ raise pytest .UsageError (f "rsyncdir doesn't exist: { root !r} " )
116
116
if root not in roots :
117
117
roots .append (root )
118
118
return roots
@@ -192,7 +192,7 @@ def _report_send_file(self, gateway, modified_rel_path):
192
192
if self ._verbose > 0 :
193
193
path = os .path .basename (self ._sourcedir ) + "/" + modified_rel_path
194
194
remotepath = gateway .spec .chdir
195
- print ("{ }:{} <= {}" . format ( gateway . spec , remotepath , path ) )
195
+ print (f" { gateway . spec } :{ remotepath } <= { path } " )
196
196
197
197
198
198
def make_reltoroot (roots : Sequence [Path ], args : List [str ]) -> List [str ]:
@@ -219,7 +219,7 @@ def make_reltoroot(roots: Sequence[Path], args: List[str]) -> List[str]:
219
219
parts [0 ] = root .name + "/" + str (x )
220
220
break
221
221
else :
222
- raise ValueError ("arg {} not relative to an rsync root" . format ( arg ) )
222
+ raise ValueError (f "arg { arg } not relative to an rsync root" )
223
223
result .append (splitcode .join (parts ))
224
224
return result
225
225
@@ -249,7 +249,7 @@ def __init__(self, nodemanager, gateway, config, putevent):
249
249
self .log = Producer (f"workerctl-{ gateway .id } " , enabled = config .option .debug )
250
250
251
251
def __repr__ (self ):
252
- return "<{} {}>" . format ( self .__class__ .__name__ , self .gateway .id )
252
+ return f "<{ self .__class__ .__name__ } { self .gateway .id } >"
253
253
254
254
@property
255
255
def shutting_down (self ):
@@ -310,11 +310,11 @@ def shutdown(self):
310
310
311
311
def sendcommand (self , name , ** kwargs ):
312
312
"""send a named parametrized command to the other side."""
313
- self .log ("sending command {}(**{})" . format ( name , kwargs ) )
313
+ self .log (f "sending command { name } (**{ kwargs } )" )
314
314
self .channel .send ((name , kwargs ))
315
315
316
316
def notify_inproc (self , eventname , ** kwargs ):
317
- self .log ("queuing {}(**{})" . format ( eventname , kwargs ) )
317
+ self .log (f "queuing { eventname } (**{ kwargs } )" )
318
318
self .putevent ((eventname , kwargs ))
319
319
320
320
def process_from_remote (self , eventcall ): # noqa too complex
@@ -336,7 +336,7 @@ def process_from_remote(self, eventcall): # noqa too complex
336
336
return
337
337
eventname , kwargs = eventcall
338
338
if eventname in ("collectionstart" ,):
339
- self .log ("ignoring {}({})" . format ( eventname , kwargs ) )
339
+ self .log (f "ignoring { eventname } ({ kwargs } )" )
340
340
elif eventname == "workerready" :
341
341
self .notify_inproc (eventname , node = self , ** kwargs )
342
342
elif eventname == "internal_error" :
@@ -389,7 +389,7 @@ def process_from_remote(self, eventcall): # noqa too complex
389
389
location = kwargs ["location" ],
390
390
)
391
391
else :
392
- raise ValueError ("unknown event: {}" . format ( eventname ) )
392
+ raise ValueError (f "unknown event: { eventname } " )
393
393
except KeyboardInterrupt :
394
394
# should not land in receiver-thread
395
395
raise
0 commit comments