@@ -32,37 +32,37 @@ class WorkspaceBuilder(object):
32
32
33
33
The normal phase of loading is:
34
34
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`::
37
37
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()
41
41
42
- or from config file with extension::
42
+ or from config file with extension::
43
43
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()
47
47
48
- kaptan automatically detects the handler from filenames.
48
+ kaptan automatically detects the handler from filenames.
49
49
50
- 2. :meth:`config.expand` sconf inline shorthand::
50
+ 2. :meth:`config.expand` sconf inline shorthand::
51
51
52
- from tmuxp import config
53
- sconf = config.expand(sconf)
52
+ from tmuxp import config
53
+ sconf = config.expand(sconf)
54
54
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::
57
57
58
- sconf = config.trickle(sconf)
58
+ sconf = config.trickle(sconf)
59
59
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::
64
64
65
- workspace = WorkspaceBuilder(sconf=sconf)
65
+ workspace = WorkspaceBuilder(sconf=sconf)
66
66
67
67
It handles the magic of cases where the user may want to start
68
68
a session inside tmux (when `$TMUX` is in the env variables).
@@ -77,12 +77,13 @@ def __init__(self, sconf, server=None):
77
77
sconf : dict
78
78
session config, includes a :py:obj:`list` of ``windows``.
79
79
80
- server : :class:`Server`
80
+ server : :class:`libtmux. Server`
81
81
tmux server to build session in
82
82
83
83
Notes
84
84
-----
85
- TODO: Initialize :class:`Session` from here, in ``self.session``.
85
+ TODO: Initialize :class:`libtmux.Session` from here, in
86
+ ``self.session``.
86
87
"""
87
88
88
89
if not sconf :
@@ -115,12 +116,13 @@ def build(self, session=None):
115
116
116
117
Optionally accepts ``session`` to build with only session object.
117
118
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.
120
122
121
123
Parameters
122
124
----------
123
- session : :class:`Session`
125
+ session : :class:`libtmux. Session`
124
126
session to build workspace in
125
127
"""
126
128
@@ -211,15 +213,16 @@ def build(self, session=None):
211
213
focus .select_window ()
212
214
213
215
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.
215
218
216
- Generator yielding :class:`Window` by iterating through
219
+ Generator yielding :class:`libtmux. Window` by iterating through
217
220
``sconf['windows']``.
218
221
219
222
Applies ``window_options`` to window.
220
223
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``)
223
226
224
227
"""
225
228
for i , wconf in enumerate (self .sconf ['windows' ], start = 1 ):
@@ -268,16 +271,21 @@ def iter_create_windows(self, s):
268
271
yield w , wconf
269
272
270
273
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.
272
276
273
277
Run ``shell_command`` with ``$ tmux send-keys``.
274
278
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``)
281
289
"""
282
290
assert (isinstance (w , Window ))
283
291
@@ -342,7 +350,7 @@ def freeze(session):
342
350
343
351
Parameters
344
352
----------
345
- session : :class:`Session`
353
+ session : :class:`libtmux. Session`
346
354
session object
347
355
348
356
Returns
0 commit comments