Skip to content

Commit

Permalink
docs(Pane): Tighten and correct docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Feb 6, 2024
1 parent 5066910 commit 31fd940
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions src/libtmux/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@

@dataclasses.dataclass()
class Window(Obj):
"""
A :term:`tmux(1)` :term:`Window` [window_manual]_.
""":term:`tmux(1)` :term:`Window` [window_manual]_.
Holds :class:`Pane` objects.
Expand Down Expand Up @@ -110,7 +109,7 @@ def session(self) -> "Session":

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

def select_pane(self, target_pane: t.Union[str, int]) -> t.Optional["Pane"]:
"""
Return selected :class:`Pane` through ``$ tmux select-pane``.
"""Select pane and return selected :class:`Pane`.
``$ tmux select-pane``.
Parameters
----------
Expand Down Expand Up @@ -182,8 +182,7 @@ def split_window(
percent: t.Optional[int] = None,
environment: t.Optional[t.Dict[str, str]] = None,
) -> "Pane":
"""
Split window and return the created :class:`Pane`.
"""Split window and return the created :class:`Pane`.
Used for splitting window and holding in a python object.
Expand Down Expand Up @@ -363,8 +362,7 @@ def set_window_option(self, option: str, value: t.Union[int, str]) -> "Window":
return self

def show_window_options(self, g: t.Optional[bool] = False) -> "WindowOptionDict":
"""
Return a dict of options for the window.
"""Return dict of options for window.
.. versionchanged:: 0.13.0
Expand Down Expand Up @@ -403,8 +401,7 @@ def show_window_options(self, g: t.Optional[bool] = False) -> "WindowOptionDict"
def show_window_option(
self, option: str, g: bool = False
) -> t.Optional[t.Union[str, int]]:
"""
Return option value for the target window.
"""Return option value for the target window.
todo: test and return True/False for on/off string
Expand Down Expand Up @@ -445,8 +442,7 @@ def show_window_option(
return value

def rename_window(self, new_name: str) -> "Window":
"""
Return :class:`Window` object ``$ tmux rename-window <new_name>``.
"""Rename window.
Parameters
----------
Expand Down Expand Up @@ -492,8 +488,7 @@ def kill_window(self) -> None:
def move_window(
self, destination: str = "", session: t.Optional[str] = None
) -> "Window":
"""
Move the current :class:`Window` object ``$ tmux move-window``.
"""Move current :class:`Window` object ``$ tmux move-window``.
Parameters
----------
Expand Down Expand Up @@ -525,8 +520,7 @@ def move_window(
# Climbers
#
def select_window(self) -> "Window":
"""
Select window. Return ``self``.
"""Select window.
To select a window object asynchrously. If a ``window`` object exists
and is no longer longer the current window, ``w.select_window()``
Expand All @@ -540,7 +534,7 @@ def select_window(self) -> "Window":
#
@property
def attached_pane(self) -> t.Optional["Pane"]:
"""Return the attached :class:`Pane`."""
"""Return attached :class:`Pane`."""
for pane in self.panes:
if pane.pane_active == "1":
return pane
Expand Down

0 comments on commit 31fd940

Please sign in to comment.