Skip to content

Commit 870f97d

Browse files
committed
Session pep8 pep257
1 parent 4c503f7 commit 870f97d

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

tmuxp/session.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def _list_windows(self):
231231

232232
return windows
233233

234+
#: Property of :meth:_list_windows()
234235
@property
235236
def _windows(self):
236237
return self._list_windows()
@@ -249,11 +250,13 @@ def list_windows(self):
249250

250251
@property
251252
def windows(self):
253+
"""Return a :py:obj:`list` of the server's :class:`Window` objects."""
252254
return self.list_windows()
255+
#: Alias of :attr:`windows`.
253256
children = windows
254257

255258
def attached_window(self):
256-
"""Returns active :class:`Window` object.
259+
"""Return active :class:`Window` object.
257260
258261
:rtype: :class:`Window`
259262
@@ -277,14 +280,14 @@ def attached_window(self):
277280
raise Exception('No Windows')
278281

279282
def select_window(self, target_window):
280-
""" Returns :class:`Window` selected via ``$ tmux select-window``.
283+
"""Return :class:`Window` selected via ``$ tmux select-window``.
281284
282-
:param: window: ``target_window`` also 'last-window' (``-l``),
283-
'next-window' (``-n``), or 'previous-window' (``-p``)
284-
:type window: integer
285-
:rtype: :class:`Window`
285+
:param: window: ``target_window`` also 'last-window' (``-l``),
286+
'next-window' (``-n``), or 'previous-window' (``-p``)
287+
:type window: integer
288+
:rtype: :class:`Window`
286289
287-
:todo: assure ``-l``, ``-n``, ``-p`` work.
290+
:todo: assure ``-l``, ``-n``, ``-p`` work.
288291
289292
"""
290293

@@ -319,14 +322,14 @@ def set_option(self, option, value):
319322
elif isinstance(value, bool) and not value:
320323
value = 'off'
321324

322-
process = self.tmux(
325+
proc = self.tmux(
323326
'set-option', option, value
324327
)
325328

326-
if process.stderr:
327-
if isinstance(process.stderr, list) and len(process.stderr) == int(1):
328-
process.stderr = process.stderr[0]
329-
raise ValueError('tmux set-option stderr: %s' % process.stderr)
329+
if proc.stderr:
330+
if isinstance(proc.stderr, list) and len(proc.stderr) == int(1):
331+
proc.stderr = proc.stderr[0]
332+
raise ValueError('tmux set-option stderr: %s' % proc.stderr)
330333

331334
def show_options(self, option=None):
332335
"""Return a dict of options for the window.
@@ -360,7 +363,7 @@ def show_options(self, option=None):
360363
def show_option(self, option):
361364
"""Return a list of options for the window.
362365
363-
todo: test and return True/False for on/off string
366+
:todo: test and return True/False for on/off string
364367
365368
:param option: option to return.
366369
:type option: string
@@ -379,4 +382,8 @@ def show_option(self, option):
379382
return window_option[1]
380383

381384
def __repr__(self):
382-
return "%s(%s %s)" % (self.__class__.__name__, self.get('session_id'), self.get('session_name'))
385+
return "%s(%s %s)" % (
386+
self.__class__.__name__,
387+
self.get('session_id'),
388+
self.get('session_name')
389+
)

0 commit comments

Comments
 (0)