diff --git a/api/library/python/iterm2/iterm2/session.py b/api/library/python/iterm2/iterm2/session.py index b95d5e0688..92604aa69e 100644 --- a/api/library/python/iterm2/iterm2/session.py +++ b/api/library/python/iterm2/iterm2/session.py @@ -175,7 +175,7 @@ class Session: Represents an iTerm2 session. """ - class Delegate: + class Delegate(abc.ABC): """ Provides callbacks for Session. """ @@ -183,16 +183,19 @@ class Delegate: def session_delegate_get_tab( self, session) -> typing.Optional['iterm2.Tab']: """Returns the tab for a session.""" + ... @abc.abstractmethod def session_delegate_get_window( self, session) -> typing.Optional['iterm2.Window']: """Returns the window for a session.""" + ... @abc.abstractmethod async def session_delegate_create_session( self, session_id: str) -> typing.Optional['iterm2.session.Session']: """Creates a new Session object given a session ID.""" + ... delegate: typing.Optional[Delegate] = None diff --git a/api/library/python/iterm2/iterm2/tab.py b/api/library/python/iterm2/iterm2/tab.py index 5925f5a4a5..54d58c9423 100644 --- a/api/library/python/iterm2/iterm2/tab.py +++ b/api/library/python/iterm2/iterm2/tab.py @@ -25,18 +25,20 @@ class Tab: Don't create this yourself. Instead, use :class:`~iterm2.App`.""" # pylint: disable=too-few-public-methods - class Delegate: + class Delegate(abc.ABC): """Delegate for Tab.""" @abc.abstractmethod def tab_delegate_get_window( self, tab: 'Tab') -> typing.Optional['iterm2.window.Window']: """Returns the Window for a Tab.""" + ... @abc.abstractmethod async def tab_delegate_get_window_by_id( self, window_id: str) -> typing.Optional['iterm2.window.Window']: """Returns the Window with the given ID.""" + ... # pylint: enable=too-few-public-methods delegate: typing.Optional[Delegate] = None diff --git a/api/library/python/iterm2/iterm2/tmux.py b/api/library/python/iterm2/iterm2/tmux.py index 9273f44168..da77ef8610 100644 --- a/api/library/python/iterm2/iterm2/tmux.py +++ b/api/library/python/iterm2/iterm2/tmux.py @@ -11,19 +11,24 @@ import iterm2.window -@abc.abstractmethod -class Delegate: +class Delegate(abc.ABC): """Delegate interface for tmux.""" + @abc.abstractmethod async def tmux_delegate_async_get_window_for_tab_id( self, tab_id: str) -> typing.Optional[iterm2.window.Window]: """Refreshes and gets the window for the specified tab.""" + ... + @abc.abstractmethod def tmux_delegate_get_session_by_id( self, session_id: str) -> typing.Optional[iterm2.session.Session]: """Returns the session with the given ID.""" + ... + @abc.abstractmethod def tmux_delegate_get_connection(self) -> iterm2.connection.Connection: """Returns the connection.""" + ... DELEGATE: typing.Optional[Delegate] = None diff --git a/api/library/python/iterm2/iterm2/window.py b/api/library/python/iterm2/iterm2/window.py index 00e427d0de..a9064220ec 100644 --- a/api/library/python/iterm2/iterm2/window.py +++ b/api/library/python/iterm2/iterm2/window.py @@ -46,25 +46,28 @@ class Window: :meth:`async_create`. """ - class Delegate: + class Delegate(abc.ABC): """Delegate for Window""" @abc.abstractmethod async def window_delegate_get_window_with_session_id( self, session_id: str) -> typing.Optional['Window']: """Gets the Window that contains a Session by ID.""" + ... @abc.abstractmethod async def window_delegate_get_tab_by_id( self, tab_id: str) -> typing.Optional[iterm2.tab.Tab]: """Gets a Tab by ID.""" + ... @abc.abstractmethod async def window_delegate_get_tab_with_session_id( self, session_id: str) -> typing.Optional[iterm2.tab.Tab]: """Returns the Tab containing a Session by ID.""" + ... delegate: typing.Optional[Delegate] = None