Skip to content

Commit 7f5760c

Browse files
committed
fix({Server,Session,Window}.children): Add deprecation warning
1 parent 49ee95e commit 7f5760c

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

src/libtmux/server.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -630,5 +630,11 @@ def list_sessions(self) -> t.List[Session]:
630630
warnings.warn("Server.list_sessions is deprecated")
631631
return self.sessions
632632

633-
#: Alias :attr:`sessions` for :class:`~libtmux.common.TmuxRelationalObject`
634-
children = sessions
633+
@property
634+
def children(self) -> QueryList["Session"]: # type:ignore
635+
"""Was used by TmuxRelationalObject (but that's longer used in this class)
636+
637+
.. deprecated:: 0.16
638+
"""
639+
warnings.warn("Server.children is deprecated")
640+
return self.sessions

src/libtmux/session.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -687,5 +687,11 @@ def list_windows(self) -> t.List["Window"]:
687687
warnings.warn("Session.list_windows() is deprecated")
688688
return self.windows
689689

690-
#: Was used by TmuxRelationalObject (but that's longer used in this class)
691-
children = windows
690+
@property
691+
def children(self) -> QueryList["Window"]: # type:ignore
692+
"""Was used by TmuxRelationalObject (but that's longer used in this class)
693+
694+
.. deprecated:: 0.16
695+
"""
696+
warnings.warn("Session.children is deprecated")
697+
return self.windows

src/libtmux/window.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,11 @@ def list_panes(self) -> t.List["Pane"]:
696696
warnings.warn("list_panes() is deprecated")
697697
return self.panes
698698

699-
#: Alias :attr:`panes`, but this wouldn't be needed as its not a
700-
#: TmuxRelationalOjbect anymore
701-
children = panes
699+
@property
700+
def children(self) -> QueryList["Pane"]: # type:ignore
701+
"""Was used by TmuxRelationalObject (but that's longer used in this class)
702+
703+
.. deprecated:: 0.16
704+
"""
705+
warnings.warn("Server.children is deprecated")
706+
return self.panes

0 commit comments

Comments
 (0)