Skip to content

Commit 4253961

Browse files
committed
refactor!(Window): Deprecate set_window_option -> set_option
1 parent 7c023e1 commit 4253961

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/libtmux/window.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@ def set_window_option(
330330
self,
331331
option: str,
332332
value: t.Union[int, str],
333+
) -> "Window":
334+
"""Set option for tmux window. Deprecated by :meth:`Window.set_option()`.
335+
336+
.. deprecated:: 0.26
337+
338+
Deprecated by :meth:`Window.set_option()`.
339+
340+
"""
341+
warnings.warn("Window.set_window_option() is deprecated", stacklevel=2)
342+
343+
return self.set_option(option=option, value=value)
344+
345+
def set_option(
346+
self,
347+
option: str,
348+
value: t.Union[int, str],
333349
format: t.Optional[bool] = None,
334350
unset: t.Optional[bool] = None,
335351
unset_panes: t.Optional[bool] = None,
@@ -355,7 +371,7 @@ def set_window_option(
355371
:exc:`exc.OptionError`, :exc:`exc.UnknownOption`,
356372
:exc:`exc.InvalidOption`, :exc:`exc.AmbiguousOption`
357373
"""
358-
flags: list[str] = []
374+
flags: t.List[str] = []
359375
if isinstance(value, bool) and value:
360376
value = "on"
361377
elif isinstance(value, bool) and not value:

0 commit comments

Comments
 (0)