From 31fd94017d25958829a1b0cbe3917fdcb283c79f Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 6 Feb 2024 06:57:35 -0600 Subject: [PATCH] docs(Pane): Tighten and correct docstrings --- src/libtmux/window.py | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/libtmux/window.py b/src/libtmux/window.py index 55a46eccf..9195b332f 100644 --- a/src/libtmux/window.py +++ b/src/libtmux/window.py @@ -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. @@ -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() ` and @@ -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 ---------- @@ -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. @@ -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 @@ -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 @@ -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 ``. + """Rename window. Parameters ---------- @@ -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 ---------- @@ -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()`` @@ -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