Skip to content

Commit db6d398

Browse files
committed
tweaks and updates to workspacebuilder docs
1 parent 7df46b9 commit db6d398

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

tmuxp/workspacebuilder.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525

2626
class WorkspaceBuilder(object):
2727

28-
"""Load workspace from session :py:obj:`dict`.
28+
"""
29+
Load workspace from session :py:obj:`dict`.
2930
3031
Build tmux workspace from a configuration. Creates and names windows, sets
3132
options, splits windows into panes.
@@ -221,9 +222,16 @@ def iter_create_windows(self, s):
221222
222223
Applies ``window_options`` to window.
223224
224-
:param session: :class:`libtmux.Session` from the config
225-
:rtype: tuple(:class:`libtmux.Window`, ``wconf``)
225+
Parameters
226+
----------
227+
session : :class:`libtmux.Session`
228+
session to create windows in
226229
230+
Returns
231+
-------
232+
tuple of (:class:`libtmux.Window`, ``wconf``)
233+
Newly created window, and the section from the tmuxp configuration
234+
that was used to create the window.
227235
"""
228236
for i, wconf in enumerate(self.sconf['windows'], start=1):
229237
if 'window_name' not in wconf:
@@ -286,6 +294,8 @@ def iter_create_panes(self, w, wconf):
286294
Returns
287295
-------
288296
tuple of (:class:`libtmux.Pane`, ``pconf``)
297+
Newly created pane, and the section from the tmuxp configuration
298+
that was used to create the pane.
289299
"""
290300
assert(isinstance(w, Window))
291301

@@ -332,10 +342,20 @@ def get_pane_start_directory():
332342

333343
yield p, pconf
334344

335-
"""
336-
Applies window configurations relevant after window and pane creation.
337-
"""
338345
def config_after_window(self, w, wconf):
346+
"""Actions to apply to window after window and pane finished.
347+
348+
When building a tmux session, sometimes its easier to postpone things
349+
like setting options until after things are already structurally
350+
prepared.
351+
352+
Parameters
353+
----------
354+
w : :class:`libtmux.Window`
355+
window to create panes for
356+
wconf : dict
357+
config section for window
358+
"""
339359
if (
340360
'options_after' in wconf and
341361
isinstance(wconf['options_after'], dict)

0 commit comments

Comments
 (0)