Skip to content

Commit 31fd940

Browse files
committed
docs(Pane): Tighten and correct docstrings
1 parent 5066910 commit 31fd940

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

Diff for: src/libtmux/window.py

+12-18
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929

3030
@dataclasses.dataclass()
3131
class Window(Obj):
32-
"""
33-
A :term:`tmux(1)` :term:`Window` [window_manual]_.
32+
""":term:`tmux(1)` :term:`Window` [window_manual]_.
3433
3534
Holds :class:`Pane` objects.
3635
@@ -110,7 +109,7 @@ def session(self) -> "Session":
110109

111110
@property
112111
def panes(self) -> QueryList["Pane"]: # type: ignore
113-
"""Panes belonging windows.
112+
"""Panes contained by window.
114113
115114
Can be accessed via
116115
:meth:`.panes.get() <libtmux._internal.query_list.QueryList.get()>` and
@@ -150,8 +149,9 @@ def cmd(self, cmd: str, *args: t.Any, **kwargs: t.Any) -> tmux_cmd:
150149
"""
151150

152151
def select_pane(self, target_pane: t.Union[str, int]) -> t.Optional["Pane"]:
153-
"""
154-
Return selected :class:`Pane` through ``$ tmux select-pane``.
152+
"""Select pane and return selected :class:`Pane`.
153+
154+
``$ tmux select-pane``.
155155
156156
Parameters
157157
----------
@@ -182,8 +182,7 @@ def split_window(
182182
percent: t.Optional[int] = None,
183183
environment: t.Optional[t.Dict[str, str]] = None,
184184
) -> "Pane":
185-
"""
186-
Split window and return the created :class:`Pane`.
185+
"""Split window and return the created :class:`Pane`.
187186
188187
Used for splitting window and holding in a python object.
189188
@@ -363,8 +362,7 @@ def set_window_option(self, option: str, value: t.Union[int, str]) -> "Window":
363362
return self
364363

365364
def show_window_options(self, g: t.Optional[bool] = False) -> "WindowOptionDict":
366-
"""
367-
Return a dict of options for the window.
365+
"""Return dict of options for window.
368366
369367
.. versionchanged:: 0.13.0
370368
@@ -403,8 +401,7 @@ def show_window_options(self, g: t.Optional[bool] = False) -> "WindowOptionDict"
403401
def show_window_option(
404402
self, option: str, g: bool = False
405403
) -> t.Optional[t.Union[str, int]]:
406-
"""
407-
Return option value for the target window.
404+
"""Return option value for the target window.
408405
409406
todo: test and return True/False for on/off string
410407
@@ -445,8 +442,7 @@ def show_window_option(
445442
return value
446443

447444
def rename_window(self, new_name: str) -> "Window":
448-
"""
449-
Return :class:`Window` object ``$ tmux rename-window <new_name>``.
445+
"""Rename window.
450446
451447
Parameters
452448
----------
@@ -492,8 +488,7 @@ def kill_window(self) -> None:
492488
def move_window(
493489
self, destination: str = "", session: t.Optional[str] = None
494490
) -> "Window":
495-
"""
496-
Move the current :class:`Window` object ``$ tmux move-window``.
491+
"""Move current :class:`Window` object ``$ tmux move-window``.
497492
498493
Parameters
499494
----------
@@ -525,8 +520,7 @@ def move_window(
525520
# Climbers
526521
#
527522
def select_window(self) -> "Window":
528-
"""
529-
Select window. Return ``self``.
523+
"""Select window.
530524
531525
To select a window object asynchrously. If a ``window`` object exists
532526
and is no longer longer the current window, ``w.select_window()``
@@ -540,7 +534,7 @@ def select_window(self) -> "Window":
540534
#
541535
@property
542536
def attached_pane(self) -> t.Optional["Pane"]:
543-
"""Return the attached :class:`Pane`."""
537+
"""Return attached :class:`Pane`."""
544538
for pane in self.panes:
545539
if pane.pane_active == "1":
546540
return pane

0 commit comments

Comments
 (0)