diff --git a/src/libtmux/server.py b/src/libtmux/server.py index fb5419a65..a9ed6b962 100644 --- a/src/libtmux/server.py +++ b/src/libtmux/server.py @@ -591,6 +591,8 @@ def _list_panes(self) -> t.List[PaneDict]: :class:`util.tmux_cmd` which wraps :py:class:`subprocess.Popen`. .. deprecated:: 0.16 + + Deprecated in favor of :attr:`.panes`. """ warnings.warn("Server._list_panes() is deprecated", stacklevel=2) return [p.__dict__ for p in self.panes] @@ -604,18 +606,32 @@ def _update_panes(self) -> "Server": :class:`Server` .. deprecated:: 0.16 + + Deprecated in favor of :attr:`.panes` and returning ``self``. """ warnings.warn("Server._update_panes() is deprecated", stacklevel=2) self._list_panes() return self def get_by_id(self, id: str) -> t.Optional[Session]: - """.. deprecated:: 0.16.""" + """Return session by id. Deprecated in favor of :meth:`.sessions.get()`. + + .. deprecated:: 0.16. + + Deprecated by :meth:`.sessions.get()`. + + """ warnings.warn("Server.get_by_id() is deprecated", stacklevel=2) return self.sessions.get(session_id=id, default=None) def where(self, kwargs: t.Dict[str, t.Any]) -> t.List[Session]: - """.. deprecated:: 0.16.""" + """Filter through sessions, return list of :class:`Session`. + + .. deprecated:: 0.16 + + Deprecated by :meth:`.session.filter()`. + + """ warnings.warn("Server.find_where() is deprecated", stacklevel=2) try: return self.sessions.filter(**kwargs) @@ -623,7 +639,13 @@ def where(self, kwargs: t.Dict[str, t.Any]) -> t.List[Session]: return [] def find_where(self, kwargs: t.Dict[str, t.Any]) -> t.Optional[Session]: - """.. deprecated:: 0.16.""" + """Filter through sessions, return first :class:`Session`. + + .. deprecated:: 0.16. + + Slated to be removed in favor of :meth:`.sessions.get()`. + + """ warnings.warn("Server.find_where() is deprecated", stacklevel=2) return self.sessions.get(default=None, **kwargs) @@ -636,6 +658,9 @@ def _list_windows(self) -> t.List[WindowDict]: :class:`common.tmux_cmd` which wraps :py:class:`subprocess.Popen`. .. deprecated:: 0.16 + + Slated to be removed in favor of :attr:`.windows`. + """ warnings.warn("Server._list_windows() is deprecated", stacklevel=2) return [w.__dict__ for w in self.windows] @@ -644,6 +669,9 @@ def _update_windows(self) -> "Server": """Update internal window data and return ``self`` for chainability. .. deprecated:: 0.16 + + Deprecated in favor of :attr:`.windows` and returning ``self``. + """ warnings.warn("Server._update_windows() is deprecated", stacklevel=2) self._list_windows() @@ -654,12 +682,20 @@ def _sessions(self) -> t.List[SessionDict]: """Property / alias to return :meth:`~._list_sessions`. .. deprecated:: 0.16 + + Slated to be removed in favor of :attr:`.sessions`. + """ warnings.warn("Server._sessions is deprecated", stacklevel=2) return self._list_sessions() def _list_sessions(self) -> t.List["SessionDict"]: - """.. deprecated:: 0.16.""" + """Return list of session object dictionaries. + + .. deprecated:: 0.16 + + Slated to be removed in favor of :attr:`.sessions`. + """ warnings.warn("Server._list_sessions() is deprecated", stacklevel=2) return [s.__dict__ for s in self.sessions] @@ -668,6 +704,8 @@ def list_sessions(self) -> t.List[Session]: .. deprecated:: 0.16 + Slated to be removed in favor of :attr:`.sessions`. + Returns ------- list of :class:`Session` @@ -680,6 +718,9 @@ def children(self) -> QueryList["Session"]: # type:ignore """Was used by TmuxRelationalObject (but that's longer used in this class). .. deprecated:: 0.16 + + Slated to be removed in favor of :meth:`.sessions`. + """ warnings.warn("Server.children is deprecated", stacklevel=2) return self.sessions