Skip to content

Commit 4c79931

Browse files
committed
Try Usage comment in util.tmux
1 parent c56f229 commit 4c79931

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

tmuxp/util.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,24 @@
2929

3030
class tmux(object):
3131

32-
''':py:mod:`subprocess` for :term:`tmux(1)`.
32+
""":py:mod:`subprocess` for :term:`tmux(1)`.
3333
34-
Usage:
34+
Usage::
3535
36-
.. code-block:: python
36+
proc = tmux('new-session', '-s%' % 'my session')
3737
38-
tmux('new-session', '-s%' % 'my session')
38+
if proc.stderr:
39+
raise Exception('Command: %s returned error: %s' % (proc.cmd, proc.stderr))
40+
41+
print('tmux command returned %s' % proc.stdout)
3942
4043
Equivalent to:
4144
4245
.. code-block:: bash
4346
4447
$ tmux new-session -s my session
45-
'''
48+
49+
"""
4650

4751
def __init__(self, *args, **kwargs):
4852
cmd = [which('tmux')]
@@ -81,16 +85,16 @@ def __init__(self, *args, **kwargs):
8185

8286
class TmuxMappingObject(collections.MutableMapping):
8387

84-
'''
85-
Base: :py:class:`collections.MutableMapping`
88+
"""Base: :py:class:`collections.MutableMapping`.
8689
8790
Convenience container. Base class for :class:`Pane`, :class:`Window`,
8891
:class:`Session` and :class:`Server`.
8992
9093
Instance attributes for useful information :term:`tmux(1)` uses for
9194
Session, Window, Pane, stored :attr:`self._TMUX`. For example, a
9295
:class:`Window` will have a ``window_id`` and ``window_name``.
93-
'''
96+
97+
"""
9498

9599
def __getitem__(self, key):
96100
return self._TMUX[key]

0 commit comments

Comments
 (0)