|
8 | 8 | import os |
9 | 9 | import shlex |
10 | 10 | import typing as t |
11 | | -from typing import Dict, Optional, Union |
12 | 11 |
|
13 | 12 | from libtmux.common import tmux_cmd |
14 | 13 | from libtmux.pane import Pane |
|
24 | 23 | ) |
25 | 24 |
|
26 | 25 | if t.TYPE_CHECKING: |
27 | | - from .common import PaneDict |
28 | 26 | from .server import Server |
29 | 27 | from .session import Session |
30 | 28 |
|
@@ -122,7 +120,7 @@ def cmd(self, cmd: str, *args: t.Any, **kwargs: t.Any) -> tmux_cmd: |
122 | 120 |
|
123 | 121 | return self.server.cmd(cmd, *args, **kwargs) |
124 | 122 |
|
125 | | - def select_layout(self, layout: Optional[str] = None) -> None: |
| 123 | + def select_layout(self, layout: t.Optional[str] = None) -> None: |
126 | 124 | """Wrapper for ``$ tmux select-layout <layout>``. |
127 | 125 |
|
128 | 126 | Parameters |
@@ -161,7 +159,7 @@ def select_layout(self, layout: Optional[str] = None) -> None: |
161 | 159 | if proc.stderr: |
162 | 160 | raise exc.LibTmuxException(proc.stderr) |
163 | 161 |
|
164 | | - def set_window_option(self, option: str, value: Union[int, str]) -> None: |
| 162 | + def set_window_option(self, option: str, value: t.Union[int, str]) -> None: |
165 | 163 | """ |
166 | 164 | Wrapper for ``$ tmux set-window-option <option> <value>``. |
167 | 165 |
|
@@ -197,7 +195,7 @@ def set_window_option(self, option: str, value: Union[int, str]) -> None: |
197 | 195 | if isinstance(cmd.stderr, list) and len(cmd.stderr): |
198 | 196 | handle_option_error(cmd.stderr[0]) |
199 | 197 |
|
200 | | - def show_window_options(self, g: Optional[bool] = False) -> WindowOptionDict: |
| 198 | + def show_window_options(self, g: t.Optional[bool] = False) -> WindowOptionDict: |
201 | 199 | """ |
202 | 200 | Return a dict of options for the window. |
203 | 201 |
|
@@ -244,7 +242,7 @@ def show_window_options(self, g: Optional[bool] = False) -> WindowOptionDict: |
244 | 242 |
|
245 | 243 | def show_window_option( |
246 | 244 | self, option: str, g: bool = False |
247 | | - ) -> Optional[Union[str, int]]: |
| 245 | + ) -> t.Optional[t.Union[str, int]]: |
248 | 246 | """ |
249 | 247 | Return a list of options for the window. |
250 | 248 |
|
@@ -330,7 +328,9 @@ def kill_window(self) -> None: |
330 | 328 |
|
331 | 329 | self.server._update_windows() |
332 | 330 |
|
333 | | - def move_window(self, destination: str = "", session: Optional[str] = None) -> None: |
| 331 | + def move_window( |
| 332 | + self, destination: str = "", session: t.Optional[str] = None |
| 333 | + ) -> None: |
334 | 334 | """ |
335 | 335 | Move the current :class:`Window` object ``$ tmux move-window``. |
336 | 336 |
|
@@ -399,12 +399,12 @@ def last_pane(self) -> t.Optional[Pane]: |
399 | 399 |
|
400 | 400 | def split_window( |
401 | 401 | self, |
402 | | - target: Optional[t.Union[int, str]] = None, |
403 | | - start_directory: Optional[str] = None, |
| 402 | + target: t.Optional[t.Union[int, str]] = None, |
| 403 | + start_directory: t.Optional[str] = None, |
404 | 404 | attach: bool = True, |
405 | 405 | vertical: bool = True, |
406 | | - shell: Optional[str] = None, |
407 | | - percent: Optional[int] = None, |
| 406 | + shell: t.Optional[str] = None, |
| 407 | + percent: t.Optional[int] = None, |
408 | 408 | ) -> Pane: |
409 | 409 | """ |
410 | 410 | Split window and return the created :class:`Pane`. |
|
0 commit comments