Skip to content

Commit bab0241

Browse files
committed
!squash cleanup more
1 parent 02c2e1f commit bab0241

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

src/libtmux/neo.py

+20-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ListCmd = Literal["list-sessions", "list-windows", "list-panes"]
1616
ListExtraArgs = t.Optional[t.Tuple[str]]
1717

18-
from libtmux.common import WindowOptionDict
18+
from libtmux.common import WindowDict, WindowOptionDict
1919
from libtmux.server import Server
2020

2121
logger = logging.getLogger(__name__)
@@ -380,6 +380,25 @@ def attached_window(self) -> "_Window":
380380
if len(self._windows) == 0:
381381
raise exc.LibTmuxException("No Windows")
382382

383+
#
384+
# Redundant stuff we want to remove
385+
#
386+
def _list_windows(self) -> t.List["WindowDict"]:
387+
return [w.__dict__ for w in self.windows]
388+
389+
@property
390+
def _windows(self) -> t.List["WindowDict"]:
391+
"""Property / alias to return :meth:`Session._list_windows`."""
392+
393+
return self._list_windows()
394+
395+
def list_windows(self) -> t.List["_Window"]:
396+
"""Return a list of :class:`Window` from the ``tmux(1)`` session."""
397+
return self.windows
398+
399+
#: Was used by TmuxRelationalObject (but that's longer used in this class)
400+
children = windows
401+
383402

384403
@dataclasses.dataclass()
385404
class _Window(Obj):
@@ -769,15 +788,12 @@ def kill_window(self) -> None:
769788

770789
proc = self.cmd(
771790
"kill-window",
772-
# '-t:%s' % self.id
773791
"-t{}:{}".format(self.session_id, self.window_index),
774792
)
775793

776794
if proc.stderr:
777795
raise exc.LibTmuxException(proc.stderr)
778796

779-
# self.server._update_windows()
780-
781797
def move_window(
782798
self, destination: str = "", session: t.Optional[str] = None
783799
) -> "_Window":

0 commit comments

Comments
 (0)