@@ -146,7 +146,7 @@ def __htmlComment(self, rawComment):
146146 continue
147147 commentLines .append (line )
148148 if commentLines or commiter :
149- return "%s <small><strong>%s </strong></small>" % ("<br/>" .join (commentLines ), commiter )
149+ return "{} <small><strong>{} </strong></small>" . format ("<br/>" .join (commentLines ), commiter )
150150 return False
151151
152152 def __showConfigurationAsText (self ):
@@ -174,7 +174,7 @@ def __setOptionValue(self, params):
174174 self .__configData ["cfgData" ].setOptionValue (optionPath , optionValue )
175175
176176 if self .__configData ["cfgData" ].getValue (optionPath ) == optionValue :
177- self .log .info ("Set option value" , "%s = %s" % ( optionPath , optionValue ) )
177+ self .log .info ("Set option value" , f" { optionPath } = { optionValue } " )
178178 return {"success" : 1 , "op" : "setOptionValue" , "parentNodeId" : params ["parentNodeId" ], "value" : optionValue }
179179 return {"success" : 0 , "op" : "setOptionValue" , "message" : "Can't update %s" % optionPath }
180180
@@ -188,7 +188,7 @@ def __setComment(self, params):
188188 self .__setCommiter ()
189189
190190 self .__configData ["cfgData" ].setComment (path , value )
191- self .log .info ("Set comment" , "%s = %s" % ( path , value ) )
191+ self .log .info ("Set comment" , f" { path } = { value } " )
192192 return {
193193 "success" : 1 ,
194194 "op" : "setComment" ,
@@ -303,8 +303,8 @@ def __createOption(self, params):
303303 return {"success" : 0 , "op" : "createOption" , "message" : "Options can't have a / in the name" }
304304 if len (optionValue ) == 0 :
305305 return {"success" : 0 , "op" : "createOption" , "message" : "Options should have values!" }
306- optionPath = "%s/%s" % ( parentPath , optionName )
307- self .log .info ("Creating option" , "%s = %s" % ( optionPath , optionValue ) )
306+ optionPath = f" { parentPath } / { optionName } "
307+ self .log .info ("Creating option" , f" { optionPath } = { optionValue } " )
308308 if not self .__configData ["cfgData" ].existsOption (optionPath ):
309309 self .__setCommiter ()
310310 self .__configData ["cfgData" ].setOptionValue (optionPath , optionValue )
@@ -336,9 +336,7 @@ def __moveNode(self, params):
336336 "oldIndex" : params ["oldIndex" ],
337337 }
338338
339- self .log .info (
340- "Moving node" , "Moving %s under %s before pos %s" % (nodePath , destinationParentPath , beforeOfIndex )
341- )
339+ self .log .info ("Moving node" , f"Moving { nodePath } under { destinationParentPath } before pos { beforeOfIndex } " )
342340 cfgData = self .__configData ["cfgData" ].getCFG ()
343341
344342 nodeDict = cfgData .getRecursive (nodePath )
@@ -584,7 +582,7 @@ def __rollback(self, params):
584582 return {"success" : 0 , "op" : "rollback" , "message" : retVal ["Value" ]}
585583
586584 def __setCommiter (self ):
587- commiter = "%s@%s - %s" % (
585+ commiter = "{}@{} - {}" . format (
588586 self .getUserName (),
589587 self .getUserGroup (),
590588 datetime .datetime .utcnow ().strftime ("%Y-%m-%d %H:%M:%S" ),
@@ -610,7 +608,7 @@ def __download(self):
610608
611609 version = str (self .__configData ["cfgData" ].getCFG ()["DIRAC" ]["Configuration" ]["Version" ])
612610 configName = str (self .__configData ["cfgData" ].getCFG ()["DIRAC" ]["Configuration" ]["Name" ])
613- fileName = "cs.%s.%s" % (configName , version .replace (":" , "" ).replace ("-" , "" ).replace (" " , "" ))
611+ fileName = "cs.{}.{}" . format (configName , version .replace (":" , "" ).replace ("-" , "" ).replace (" " , "" ))
614612
615613 return {"success" : 1 , "op" : "download" , "result" : self .__configData ["strCfgData" ], "fileName" : fileName }
616614
0 commit comments