Skip to content

Commit fbeac68

Browse files
committed
update docs to link to libtmux objects
1 parent a6d7792 commit fbeac68

File tree

1 file changed

+46
-38
lines changed

1 file changed

+46
-38
lines changed

tmuxp/workspacebuilder.py

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,37 @@ class WorkspaceBuilder(object):
3232
3333
The normal phase of loading is:
3434
35-
1. :term:`kaptan` imports json/yaml/ini. ``.get()`` returns python
36-
:class:`dict`::
35+
1. :term:`kaptan` imports json/yaml/ini. ``.get()`` returns python
36+
:class:`dict`::
3737
38-
import kaptan
39-
sconf = kaptan.Kaptan(handler='yaml')
40-
sconf = sconfig.import_config(self.yaml_config).get()
38+
import kaptan
39+
sconf = kaptan.Kaptan(handler='yaml')
40+
sconf = sconfig.import_config(self.yaml_config).get()
4141
42-
or from config file with extension::
42+
or from config file with extension::
4343
44-
import kaptan
45-
sconf = kaptan.Kaptan()
46-
sconf = sconfig.import_config('path/to/config.yaml').get()
44+
import kaptan
45+
sconf = kaptan.Kaptan()
46+
sconf = sconfig.import_config('path/to/config.yaml').get()
4747
48-
kaptan automatically detects the handler from filenames.
48+
kaptan automatically detects the handler from filenames.
4949
50-
2. :meth:`config.expand` sconf inline shorthand::
50+
2. :meth:`config.expand` sconf inline shorthand::
5151
52-
from tmuxp import config
53-
sconf = config.expand(sconf)
52+
from tmuxp import config
53+
sconf = config.expand(sconf)
5454
55-
3. :meth:`config.trickle` passes down default values from session
56-
-> window -> pane if applicable::
55+
3. :meth:`config.trickle` passes down default values from session
56+
-> window -> pane if applicable::
5757
58-
sconf = config.trickle(sconf)
58+
sconf = config.trickle(sconf)
5959
60-
4. (You are here) We will create a :class:`Session` (a real
61-
``tmux(1)`` session) and iterate through the list of windows, and
62-
their panes, returning full :class:`Window` and :class:`Pane`
63-
objects each step of the way::
60+
4. (You are here) We will create a :class:`libtmux.Session` (a real
61+
``tmux(1)`` session) and iterate through the list of windows, and
62+
their panes, returning full :class:`libtmux.Window` and
63+
:class:`libtmux.Pane` objects each step of the way::
6464
65-
workspace = WorkspaceBuilder(sconf=sconf)
65+
workspace = WorkspaceBuilder(sconf=sconf)
6666
6767
It handles the magic of cases where the user may want to start
6868
a session inside tmux (when `$TMUX` is in the env variables).
@@ -77,12 +77,13 @@ def __init__(self, sconf, server=None):
7777
sconf : dict
7878
session config, includes a :py:obj:`list` of ``windows``.
7979
80-
server : :class:`Server`
80+
server : :class:`libtmux.Server`
8181
tmux server to build session in
8282
8383
Notes
8484
-----
85-
TODO: Initialize :class:`Session` from here, in ``self.session``.
85+
TODO: Initialize :class:`libtmux.Session` from here, in
86+
``self.session``.
8687
"""
8788

8889
if not sconf:
@@ -115,12 +116,13 @@ def build(self, session=None):
115116
116117
Optionally accepts ``session`` to build with only session object.
117118
118-
Without ``session``, it will use :class:`Server` at ``self.server``
119-
passed in on initialization to create a new Session object.
119+
Without ``session``, it will use :class:`libmtux.Server` at
120+
``self.server`` passed in on initialization to create a new Session
121+
object.
120122
121123
Parameters
122124
----------
123-
session : :class:`Session`
125+
session : :class:`libtmux.Session`
124126
session to build workspace in
125127
"""
126128

@@ -211,15 +213,16 @@ def build(self, session=None):
211213
focus.select_window()
212214

213215
def iter_create_windows(self, s):
214-
"""Return :class:`Window` iterating through session config dict.
216+
"""
217+
Return :class:`libtmux.Window` iterating through session config dict.
215218
216-
Generator yielding :class:`Window` by iterating through
219+
Generator yielding :class:`libtmux.Window` by iterating through
217220
``sconf['windows']``.
218221
219222
Applies ``window_options`` to window.
220223
221-
:param session: :class:`Session` from the config
222-
:rtype: tuple(:class:`Window`, ``wconf``)
224+
:param session: :class:`libtmux.Session` from the config
225+
:rtype: tuple(:class:`libtmux.Window`, ``wconf``)
223226
224227
"""
225228
for i, wconf in enumerate(self.sconf['windows'], start=1):
@@ -268,16 +271,21 @@ def iter_create_windows(self, s):
268271
yield w, wconf
269272

270273
def iter_create_panes(self, w, wconf):
271-
"""Return :class:`Pane` iterating through window config dict.
274+
"""
275+
Return :class:`libtmux.Pane` iterating through window config dict.
272276
273277
Run ``shell_command`` with ``$ tmux send-keys``.
274278
275-
:param w: window to create panes for
276-
:type w: :class:`Window`
277-
:param wconf: config section for window
278-
:type wconf: :py:obj:`dict`
279-
:rtype: tuple(:class:`Pane`, ``pconf``)
280-
279+
Parameters
280+
----------
281+
w : :class:`libtmux.Window`
282+
window to create panes for
283+
wconf : dict
284+
config section for window
285+
286+
Returns
287+
-------
288+
tuple of (:class:`libtmux.Pane`, ``pconf``)
281289
"""
282290
assert(isinstance(w, Window))
283291

@@ -342,7 +350,7 @@ def freeze(session):
342350
343351
Parameters
344352
----------
345-
session : :class:`Session`
353+
session : :class:`libtmux.Session`
346354
session object
347355
348356
Returns

0 commit comments

Comments
 (0)