Skip to content

Commit 962832b

Browse files
committed
refactor!(Window): Deprecate set_window_option -> set_option
1 parent 26057f6 commit 962832b

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
@@ -331,6 +331,22 @@ def set_window_option(
331331
self,
332332
option: str,
333333
value: t.Union[int, str],
334+
) -> "Window":
335+
"""Set option for tmux window. Deprecated by :meth:`Window.set_option()`.
336+
337+
.. deprecated:: 0.26
338+
339+
Deprecated by :meth:`Window.set_option()`.
340+
341+
"""
342+
warnings.warn("Window.set_window_option() is deprecated", stacklevel=2)
343+
344+
return self.set_option(option=option, value=value)
345+
346+
def set_option(
347+
self,
348+
option: str,
349+
value: t.Union[int, str],
334350
format: t.Optional[bool] = None,
335351
unset: t.Optional[bool] = None,
336352
unset_panes: t.Optional[bool] = None,
@@ -356,7 +372,7 @@ def set_window_option(
356372
:exc:`exc.OptionError`, :exc:`exc.UnknownOption`,
357373
:exc:`exc.InvalidOption`, :exc:`exc.AmbiguousOption`
358374
"""
359-
flags: list[str] = []
375+
flags: t.List[str] = []
360376
if isinstance(value, bool) and value:
361377
value = "on"
362378
elif isinstance(value, bool) and not value:

0 commit comments

Comments
 (0)