Skip to content

Commit 186a334

Browse files
committed
pep8 tmuxp.util tmuxp.workspacebuilder
1 parent ecca033 commit 186a334

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

tmuxp/util.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ class tmux(object):
3737
proc = tmux('new-session', '-s%' % 'my session')
3838
3939
if proc.stderr:
40-
raise exc.TmuxpException('Command: %s returned error: %s' % (proc.cmd, proc.stderr))
40+
raise exc.TmuxpException(
41+
'Command: %s returned error: %s' % (proc.cmd, proc.stderr)
42+
)
4143
4244
print('tmux command returned %s' % proc.stdout)
4345
@@ -113,6 +115,7 @@ def __delitem__(self, key):
113115
self.dirty = True
114116

115117
def keys(self):
118+
"""Return list of keys."""
116119
return self._TMUX.keys()
117120

118121
def __iter__(self):
@@ -281,7 +284,10 @@ def oh_my_zsh_auto_title():
281284
if 'SHELL' in os.environ and 'zsh' in os.environ.get('SHELL'):
282285
if os.path.exists(os.path.expanduser('~/.oh-my-zsh')):
283286
# oh-my-zsh exists
284-
if 'DISABLE_AUTO_TITLE' not in os.environ or os.environ.get('DISABLE_AUTO_TITLE') == "false":
287+
if (
288+
'DISABLE_AUTO_TITLE' not in os.environ or
289+
os.environ.get('DISABLE_AUTO_TITLE') == "false"
290+
):
285291
print('Please set:\n\n'
286292
'\texport DISABLE_AUTO_TITLE = \'true\'\n\n'
287293
'in ~/.zshrc or where your zsh profile is stored.\n'

tmuxp/workspacebuilder.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,12 @@ def freeze(session):
256256
wconf['layout'] = w.get('window_layout')
257257
wconf['panes'] = []
258258

259-
if all(w.panes[0].get('pane_current_path') == p.get('pane_current_path') for p in w.panes):
259+
if (
260+
all(
261+
w.panes[0].get('pane_current_path') ==
262+
p.get('pane_current_path') for p in w.panes
263+
)
264+
):
260265
wconf['start_directory'] = w.panes[0].get('pane_current_path')
261266

262267
for p in w.panes:
@@ -270,8 +275,13 @@ def freeze(session):
270275

271276
current_cmd = p.get('pane_current_command')
272277

273-
if current_cmd.startswith('-') or \
274-
any(current_cmd.endswith(cmd) for cmd in ['python', 'ruby', 'node']):
278+
if (
279+
current_cmd.startswith('-') or
280+
any(
281+
current_cmd.endswith(cmd)
282+
for cmd in ['python', 'ruby', 'node']
283+
)
284+
):
275285
current_cmd = None
276286

277287
if current_cmd:

0 commit comments

Comments
 (0)