@@ -231,6 +231,7 @@ def _list_windows(self):
231
231
232
232
return windows
233
233
234
+ #: Property of :meth:_list_windows()
234
235
@property
235
236
def _windows (self ):
236
237
return self ._list_windows ()
@@ -249,11 +250,13 @@ def list_windows(self):
249
250
250
251
@property
251
252
def windows (self ):
253
+ """Return a :py:obj:`list` of the server's :class:`Window` objects."""
252
254
return self .list_windows ()
255
+ #: Alias of :attr:`windows`.
253
256
children = windows
254
257
255
258
def attached_window (self ):
256
- """Returns active :class:`Window` object.
259
+ """Return active :class:`Window` object.
257
260
258
261
:rtype: :class:`Window`
259
262
@@ -277,14 +280,14 @@ def attached_window(self):
277
280
raise Exception ('No Windows' )
278
281
279
282
def select_window (self , target_window ):
280
- """ Returns :class:`Window` selected via ``$ tmux select-window``.
283
+ """Return :class:`Window` selected via ``$ tmux select-window``.
281
284
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`
286
289
287
- :todo: assure ``-l``, ``-n``, ``-p`` work.
290
+ :todo: assure ``-l``, ``-n``, ``-p`` work.
288
291
289
292
"""
290
293
@@ -319,14 +322,14 @@ def set_option(self, option, value):
319
322
elif isinstance (value , bool ) and not value :
320
323
value = 'off'
321
324
322
- process = self .tmux (
325
+ proc = self .tmux (
323
326
'set-option' , option , value
324
327
)
325
328
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 )
330
333
331
334
def show_options (self , option = None ):
332
335
"""Return a dict of options for the window.
@@ -360,7 +363,7 @@ def show_options(self, option=None):
360
363
def show_option (self , option ):
361
364
"""Return a list of options for the window.
362
365
363
- todo: test and return True/False for on/off string
366
+ : todo: test and return True/False for on/off string
364
367
365
368
:param option: option to return.
366
369
:type option: string
@@ -379,4 +382,8 @@ def show_option(self, option):
379
382
return window_option [1 ]
380
383
381
384
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