@@ -143,7 +143,7 @@ def _validate_choices(options):
143143 def func (value ):
144144 if value not in options :
145145 raise click .BadParameter (
146- "Possible choices are: {0 }." .format (", " .join (options ))
146+ "Possible choices are: {}." .format (", " .join (options ))
147147 )
148148 return value
149149
@@ -188,7 +188,7 @@ def set_layout_hook(session, hook_name):
188188 # unfortunately, select-layout won't work unless
189189 # we've literally selected the window at least once
190190 # with the client
191- hook_cmd .append ("selectw -t {}" . format ( window .id ) )
191+ hook_cmd .append (f "selectw -t { window .id } " )
192192 # edit: removed -t, or else it won't respect main-pane-w/h
193193 hook_cmd .append ("selectl" )
194194 hook_cmd .append ("selectw -p" )
@@ -199,7 +199,7 @@ def set_layout_hook(session, hook_name):
199199 target_session = session .id , hook_name = hook_name
200200 )
201201 )
202- hook_cmd .append ("selectw -t {}" . format ( attached_window .id ) )
202+ hook_cmd .append (f "selectw -t { attached_window .id } " )
203203
204204 # join the hook's commands with semicolons
205205 hook_cmd = "{}" .format ("; " .join (hook_cmd ))
@@ -236,7 +236,7 @@ def is_pure_name(path):
236236
237237class ConfigPath (click .Path ):
238238 def __init__ (self , config_dir = None , * args , ** kwargs ):
239- super (ConfigPath , self ).__init__ (* args , ** kwargs )
239+ super ().__init__ (* args , ** kwargs )
240240 self .config_dir = config_dir
241241
242242 def convert (self , value , param , ctx ):
@@ -245,7 +245,7 @@ def convert(self, value, param, ctx):
245245 config_dir = config_dir ()
246246
247247 value = scan_config (value , config_dir = config_dir )
248- return super (ConfigPath , self ).convert (value , param , ctx )
248+ return super ().convert (value , param , ctx )
249249
250250
251251def scan_config_argument (ctx , param , value , config_dir = None ):
@@ -264,7 +264,7 @@ def scan_config_argument(ctx, param, value, config_dir=None):
264264 value = scan_config (value , config_dir = config_dir )
265265
266266 elif isinstance (value , tuple ):
267- value = tuple ([ scan_config (v , config_dir = config_dir ) for v in value ] )
267+ value = tuple (scan_config (v , config_dir = config_dir ) for v in value )
268268
269269 return value
270270
@@ -346,7 +346,7 @@ def scan_config(config, config_dir=None):
346346 candidates = [
347347 x
348348 for x in [
349- "%s%s" % ( join (config_dir , config ), ext )
349+ f" { join (config_dir , config )} { ext } "
350350 for ext in VALID_CONFIG_DIR_FILE_EXTENSIONS
351351 ]
352352 if exists (x )
@@ -421,8 +421,8 @@ def load_plugins(sconf):
421421 except Exception as error :
422422 click .echo (
423423 click .style ("[Plugin Error] " , fg = "red" )
424- + "Couldn't load {0 }\n " . format ( plugin )
425- + click .style ("{0}" . format ( error ) , fg = "yellow" )
424+ + f "Couldn't load { plugin } \n "
425+ + click .style (f" { error } " , fg = "yellow" )
426426 )
427427 sys .exit (1 )
428428
@@ -985,7 +985,7 @@ def command_freeze(
985985 save_to = os .path .abspath (
986986 os .path .join (
987987 get_config_dir (),
988- "%s.%s" % (sconf .get ("session_name" ), config_format or "yaml" ),
988+ "{}.{}" . format (sconf .get ("session_name" ), config_format or "yaml" ),
989989 )
990990 )
991991 dest_prompt = click .prompt (
@@ -1135,7 +1135,6 @@ def command_load(
11351135@cli .group (name = "import" )
11361136def import_config_cmd ():
11371137 """Import a teamocil/tmuxinator config."""
1138- pass
11391138
11401139
11411140def import_config (configfile , importfunc ):
@@ -1229,7 +1228,7 @@ def command_convert(confirmed, config):
12291228 to_filetype = "json"
12301229 else :
12311230 raise click .BadParameter (
1232- "Unknown filetype: %s (valid: [.json, .yaml, .yml])" % ( ext ,)
1231+ f "Unknown filetype: { ext } (valid: [.json, .yaml, .yml])"
12331232 )
12341233
12351234 configparser = kaptan .Kaptan ()
@@ -1240,7 +1239,7 @@ def command_convert(confirmed, config):
12401239 newconfig = configparser .export (to_filetype , indent = 2 , ** export_kwargs )
12411240
12421241 if not confirmed :
1243- if click .confirm ("convert to <%s > to %s?" % ( config , to_filetype ) ):
1242+ if click .confirm (f "convert to <{ config } > to { to_filetype } ?" ):
12441243 if click .confirm ("Save config to %s?" % newfile ):
12451244 confirmed = True
12461245
@@ -1260,9 +1259,7 @@ def command_edit_config(config):
12601259 call ([sys_editor , config ])
12611260
12621261
1263- @cli .command (
1264- name = "ls" , short_help = "List configured sessions in {}." .format (get_config_dir ())
1265- )
1262+ @cli .command (name = "ls" , short_help = f"List configured sessions in { get_config_dir ()} ." )
12661263def command_ls ():
12671264 tmuxp_dir = get_config_dir ()
12681265 if os .path .exists (tmuxp_dir ) and os .path .isdir (tmuxp_dir ):
0 commit comments