1616from click .exceptions import FileError
1717
1818from libtmux .common import (
19- has_gte_version ,
20- has_minimum_version ,
21- which ,
19+ has_gte_version ,
20+ has_minimum_version ,
21+ which ,
2222 get_version ,
23- tmux_cmd
23+ tmux_cmd ,
2424)
2525from libtmux .exc import TmuxCommandNotFound
2626from libtmux .server import Server
@@ -855,9 +855,7 @@ def command_freeze(session_name, socket_name, socket_path, force):
855855@click .argument ('config' , type = ConfigPath (exists = True ), nargs = - 1 )
856856@click .option ('-S' , 'socket_path' , help = 'pass-through for tmux -S' )
857857@click .option ('-L' , 'socket_name' , help = 'pass-through for tmux -L' )
858- @click .option (
859- '-s' , 'new_session_name' , help = 'start new session with new session name'
860- )
858+ @click .option ('-s' , 'new_session_name' , help = 'start new session with new session name' )
861859@click .option ('--yes' , '-y' , 'answer_yes' , help = 'yes' , is_flag = True )
862860@click .option (
863861 '-d' , 'detached' , help = 'Load the session without attaching it' , is_flag = True
@@ -883,7 +881,7 @@ def command_load(
883881 new_session_name ,
884882 answer_yes ,
885883 detached ,
886- colors
884+ colors ,
887885):
888886 """Load a tmux workspace from each CONFIG.
889887
@@ -1075,10 +1073,7 @@ def prepend_tab(strings):
10751073 """
10761074 Prepend tab to strings in list.
10771075 """
1078- return list (map (
1079- lambda x : '\t %s' % x ,
1080- strings
1081- ))
1076+ return list (map (lambda x : '\t %s' % x , strings ))
10821077
10831078 def output_break ():
10841079 """
@@ -1090,22 +1085,26 @@ def format_tmux_resp(std_resp):
10901085 """
10911086 Format tmux command response for tmuxp stdout.
10921087 """
1093- return '\n ' .join ([
1094- * prepend_tab (std_resp .stdout ),
1095- click .style (
1096- '\n ' .join (prepend_tab (std_resp .stderr )),
1097- fg = 'red'
1098- )
1099- ])
1088+ return '\n ' .join (
1089+ [
1090+ * prepend_tab (std_resp .stdout ),
1091+ click .style ('\n ' .join (prepend_tab (std_resp .stderr )), fg = 'red' ),
1092+ ]
1093+ )
11001094
11011095 output = [
11021096 output_break (),
1103- 'environment:\n %s' % '\n ' .join (prepend_tab ([
1104- 'system: %s' % os .uname ().sysname ,
1105- 'arch: %s' % os .uname ().machine ,
1106- 'os: {0} {1}' .format (os .uname ().nodename , os .uname ().version ),
1107- 'kernel: %s' % os .uname ().release ,
1108- ])),
1097+ 'environment:\n %s'
1098+ % '\n ' .join (
1099+ prepend_tab (
1100+ [
1101+ 'system: %s' % os .uname ().sysname ,
1102+ 'arch: %s' % os .uname ().machine ,
1103+ 'os: {0} {1}' .format (os .uname ().nodename , os .uname ().version ),
1104+ 'kernel: %s' % os .uname ().release ,
1105+ ]
1106+ )
1107+ ),
11091108 output_break (),
11101109 'python version: %s' % ' ' .join (sys .version .split ('\n ' )),
11111110 'system PATH: %s' % os .environ ['PATH' ],
@@ -1116,21 +1115,12 @@ def format_tmux_resp(std_resp):
11161115 'tmuxp path: %s' % tmuxp_path ,
11171116 'shell: %s' % os .environ ['SHELL' ],
11181117 output_break (),
1119- 'tmux sessions:\n %s' % format_tmux_resp (
1120- tmux_cmd ('list-sessions' )
1121- ),
1122- 'tmux windows:\n %s' % format_tmux_resp (
1123- tmux_cmd ('list-windows' )
1124- ),
1125- 'tmux panes:\n %s' % format_tmux_resp (
1126- tmux_cmd ('list-panes' )
1127- ),
1128- 'tmux global options:\n %s' % format_tmux_resp (
1129- tmux_cmd ('show-options' , '-g' )
1130- ),
1131- 'tmux window options:\n %s' % format_tmux_resp (
1132- tmux_cmd ('show-window-options' , '-g' )
1133- )
1118+ 'tmux sessions:\n %s' % format_tmux_resp (tmux_cmd ('list-sessions' )),
1119+ 'tmux windows:\n %s' % format_tmux_resp (tmux_cmd ('list-windows' )),
1120+ 'tmux panes:\n %s' % format_tmux_resp (tmux_cmd ('list-panes' )),
1121+ 'tmux global options:\n %s' % format_tmux_resp (tmux_cmd ('show-options' , '-g' )),
1122+ 'tmux window options:\n %s'
1123+ % format_tmux_resp (tmux_cmd ('show-window-options' , '-g' )),
11341124 ]
11351125
11361126 click .echo ('\n ' .join (output ))
0 commit comments