@@ -51,7 +51,7 @@ def __init__(self, *args):
5151 s += " ["
5252 i = []
5353 for a , d in zip (args [len (args )- len (defs ):], defs ):
54- i .append ("{ }={}" . format ( a , d ) if d is not None else a )
54+ i .append (f" { a } ={ d } " if d is not None else a )
5555 s += " " .join (i ) + "]"
5656 self .signature = s
5757 self .args , self .defaults = args , defs
@@ -182,7 +182,7 @@ def get_help(cls, *levels, **kwargs):
182182 continue
183183 d .append ([n , getattr (c , "description" , "" )])
184184 if len (d ) > 1 :
185- t = BorderlessTable (d , "{} commands" . format ( l .capitalize ()) )
185+ t = BorderlessTable (d , f" { l .capitalize ()} commands" )
186186 s += t .table + "\n "
187187 i += 1
188188 return "\n " + s .strip () + "\n " if i > 0 else ""
@@ -200,13 +200,13 @@ def register_command(cls, subcls):
200200 Command .commands [l ][subcls .name ] = subcls
201201 for alias in subcls .aliases :
202202 Command .commands [l ][alias ] = subcls
203- logger .detail ("Registered command alias '{}'" . format ( alias ) )
203+ logger .detail (f "Registered command alias '{ alias } '" )
204204
205205 @classmethod
206206 def set_style (cls , style ):
207207 """ Set the style of command name. """
208208 if style not in COMMAND_STYLES :
209- raise ValueError ("Command style must be one of the followings: [{}]" . format ( "|" .join (COMMAND_STYLES )) )
209+ raise ValueError (f "Command style must be one of the followings: [{ '|' .join (COMMAND_STYLES )} ]" )
210210 MetaCommand .style = style
211211
212212 @classmethod
@@ -234,7 +234,7 @@ def unregister_command(cls, subcls):
234234 for l in levels :
235235 if len (Command .commands [l ]) == 0 :
236236 del Command .commands [l ]
237- logger .detail ("Unregistered command '{}/{}'" . format ( l , n ) )
237+ logger .detail (f "Unregistered command '{ l } /{ n } '" )
238238
239239 @classmethod
240240 def unregister_commands (cls , * identifiers ):
@@ -248,7 +248,7 @@ def unregister_commands(cls, *identifiers):
248248 # apply deletions
249249 if n is None :
250250 if f not in cls ._functionalities :
251- raise ValueError ("Unknown functionality {}" . format ( f ) )
251+ raise ValueError (f "Unknown functionality { f } " )
252252 p = Path (__file__ ).parent .joinpath ("../base/commands/" + f + ".py" ).resolve ()
253253 for c in PythonPath (str (p )).get_classes (Command ):
254254 Command .unregister_command (c )
0 commit comments