Skip to content

Commit bbb4733

Browse files
committed
!squash flake8
1 parent 1996568 commit bbb4733

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

libtmux/server.py

-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424

2525
logger = logging.getLogger(__name__)
2626

27-
if t.TYPE_CHECKING:
28-
from libtmux.common import SessionDict
29-
from libtmux.window import Window
30-
3127

3228
class Server(TmuxRelationalObject["Session", "SessionDict"], EnvironmentMixin):
3329

libtmux/session.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import logging
88
import os
99
import typing as t
10-
from typing import Dict, Optional, Union
1110

1211
from libtmux.common import tmux_cmd
1312
from libtmux.window import Window
@@ -184,7 +183,7 @@ def rename_session(self, new_name: str) -> "Session":
184183

185184
def new_window(
186185
self,
187-
window_name: Optional[str] = None,
186+
window_name: t.Optional[str] = None,
188187
start_directory: None = None,
189188
attach: bool = True,
190189
window_index: str = "",
@@ -268,7 +267,7 @@ def new_window(
268267

269268
return window
270269

271-
def kill_window(self, target_window: Optional[str] = None) -> None:
270+
def kill_window(self, target_window: t.Optional[str] = None) -> None:
272271
"""Close a tmux window, and all panes inside it, ``$ tmux kill-window``
273272
274273
Kill the current window or the window at ``target-window``. removing it
@@ -388,7 +387,7 @@ def attached_pane(self) -> t.Optional["Pane"]:
388387
return self.attached_window.attached_pane
389388

390389
def set_option(
391-
self, option: str, value: Union[str, int], _global: bool = False
390+
self, option: str, value: t.Union[str, int], _global: bool = False
392391
) -> None:
393392
"""
394393
Set option ``$ tmux set-option <option> <value>``.
@@ -438,8 +437,8 @@ def set_option(
438437
handle_option_error(proc.stderr[0])
439438

440439
def show_options(
441-
self, _global: Optional[bool] = False
442-
) -> t.Dict[str, Union[str, int]]:
440+
self, _global: t.Optional[bool] = False
441+
) -> t.Dict[str, t.Union[str, int]]:
443442
"""
444443
Return a dict of options for the window.
445444
@@ -481,7 +480,7 @@ def show_options(
481480

482481
def show_option(
483482
self, option: str, _global: bool = False
484-
) -> Optional[Union[str, int, bool]]:
483+
) -> t.Optional[t.Union[str, int, bool]]:
485484
"""Return a list of options for the window.
486485
487486
Parameters

libtmux/window.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import os
99
import shlex
1010
import typing as t
11-
from typing import Dict, Optional, Union
1211

1312
from libtmux.common import tmux_cmd
1413
from libtmux.pane import Pane
@@ -24,7 +23,6 @@
2423
)
2524

2625
if t.TYPE_CHECKING:
27-
from .common import PaneDict
2826
from .server import Server
2927
from .session import Session
3028

@@ -122,7 +120,7 @@ def cmd(self, cmd: str, *args: t.Any, **kwargs: t.Any) -> tmux_cmd:
122120

123121
return self.server.cmd(cmd, *args, **kwargs)
124122

125-
def select_layout(self, layout: Optional[str] = None) -> None:
123+
def select_layout(self, layout: t.Optional[str] = None) -> None:
126124
"""Wrapper for ``$ tmux select-layout <layout>``.
127125
128126
Parameters
@@ -161,7 +159,7 @@ def select_layout(self, layout: Optional[str] = None) -> None:
161159
if proc.stderr:
162160
raise exc.LibTmuxException(proc.stderr)
163161

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:
165163
"""
166164
Wrapper for ``$ tmux set-window-option <option> <value>``.
167165
@@ -197,7 +195,7 @@ def set_window_option(self, option: str, value: Union[int, str]) -> None:
197195
if isinstance(cmd.stderr, list) and len(cmd.stderr):
198196
handle_option_error(cmd.stderr[0])
199197

200-
def show_window_options(self, g: Optional[bool] = False) -> WindowOptionDict:
198+
def show_window_options(self, g: t.Optional[bool] = False) -> WindowOptionDict:
201199
"""
202200
Return a dict of options for the window.
203201
@@ -244,7 +242,7 @@ def show_window_options(self, g: Optional[bool] = False) -> WindowOptionDict:
244242

245243
def show_window_option(
246244
self, option: str, g: bool = False
247-
) -> Optional[Union[str, int]]:
245+
) -> t.Optional[t.Union[str, int]]:
248246
"""
249247
Return a list of options for the window.
250248
@@ -330,7 +328,9 @@ def kill_window(self) -> None:
330328

331329
self.server._update_windows()
332330

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:
334334
"""
335335
Move the current :class:`Window` object ``$ tmux move-window``.
336336
@@ -399,12 +399,12 @@ def last_pane(self) -> t.Optional[Pane]:
399399

400400
def split_window(
401401
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,
404404
attach: bool = True,
405405
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,
408408
) -> Pane:
409409
"""
410410
Split window and return the created :class:`Pane`.

0 commit comments

Comments
 (0)