@@ -51,7 +51,7 @@ def __init__(self, *args):
51
51
s += " ["
52
52
i = []
53
53
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 )
55
55
s += " " .join (i ) + "]"
56
56
self .signature = s
57
57
self .args , self .defaults = args , defs
@@ -182,7 +182,7 @@ def get_help(cls, *levels, **kwargs):
182
182
continue
183
183
d .append ([n , getattr (c , "description" , "" )])
184
184
if len (d ) > 1 :
185
- t = BorderlessTable (d , "{} commands" . format ( l .capitalize ()) )
185
+ t = BorderlessTable (d , f" { l .capitalize ()} commands" )
186
186
s += t .table + "\n "
187
187
i += 1
188
188
return "\n " + s .strip () + "\n " if i > 0 else ""
@@ -200,13 +200,13 @@ def register_command(cls, subcls):
200
200
Command .commands [l ][subcls .name ] = subcls
201
201
for alias in subcls .aliases :
202
202
Command .commands [l ][alias ] = subcls
203
- logger .detail ("Registered command alias '{}'" . format ( alias ) )
203
+ logger .detail (f "Registered command alias '{ alias } '" )
204
204
205
205
@classmethod
206
206
def set_style (cls , style ):
207
207
""" Set the style of command name. """
208
208
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 )} ]" )
210
210
MetaCommand .style = style
211
211
212
212
@classmethod
@@ -234,7 +234,7 @@ def unregister_command(cls, subcls):
234
234
for l in levels :
235
235
if len (Command .commands [l ]) == 0 :
236
236
del Command .commands [l ]
237
- logger .detail ("Unregistered command '{}/{}'" . format ( l , n ) )
237
+ logger .detail (f "Unregistered command '{ l } /{ n } '" )
238
238
239
239
@classmethod
240
240
def unregister_commands (cls , * identifiers ):
@@ -248,7 +248,7 @@ def unregister_commands(cls, *identifiers):
248
248
# apply deletions
249
249
if n is None :
250
250
if f not in cls ._functionalities :
251
- raise ValueError ("Unknown functionality {}" . format ( f ) )
251
+ raise ValueError (f "Unknown functionality { f } " )
252
252
p = Path (__file__ ).parent .joinpath ("../base/commands/" + f + ".py" ).resolve ()
253
253
for c in PythonPath (str (p )).get_classes (Command ):
254
254
Command .unregister_command (c )
0 commit comments