From 68d05208d41a344b4527b74926e0c20332d6418f Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Sun, 17 Nov 2024 09:52:17 -0800 Subject: [PATCH] add `_curses_panel` module (#13028) --- stdlib/@tests/stubtest_allowlists/win32.txt | 1 + stdlib/VERSIONS | 1 + stdlib/_curses_panel.pyi | 27 +++++++++++++++++++++ stdlib/curses/panel.pyi | 23 +----------------- 4 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 stdlib/_curses_panel.pyi diff --git a/stdlib/@tests/stubtest_allowlists/win32.txt b/stdlib/@tests/stubtest_allowlists/win32.txt index eff99aaf6..1fabe3bcb 100644 --- a/stdlib/@tests/stubtest_allowlists/win32.txt +++ b/stdlib/@tests/stubtest_allowlists/win32.txt @@ -45,6 +45,7 @@ curses.ascii curses.has_key curses.panel curses.textpad +_curses_panel # Modules that rely on termios pty diff --git a/stdlib/VERSIONS b/stdlib/VERSIONS index 702fdbab7..0d704cefb 100644 --- a/stdlib/VERSIONS +++ b/stdlib/VERSIONS @@ -33,6 +33,7 @@ _contextvars: 3.7- _csv: 3.0- _ctypes: 3.0- _curses: 3.0- +_curses_panel: 3.0- _dbm: 3.0- _decimal: 3.3- _dummy_thread: 3.0-3.8 diff --git a/stdlib/_curses_panel.pyi b/stdlib/_curses_panel.pyi new file mode 100644 index 000000000..ddec22236 --- /dev/null +++ b/stdlib/_curses_panel.pyi @@ -0,0 +1,27 @@ +from _curses import window +from typing import final + +__version__: str +version: str + +class error(Exception): ... + +@final +class panel: + def above(self) -> panel: ... + def below(self) -> panel: ... + def bottom(self) -> None: ... + def hidden(self) -> bool: ... + def hide(self) -> None: ... + def move(self, y: int, x: int, /) -> None: ... + def replace(self, win: window, /) -> None: ... + def set_userptr(self, obj: object, /) -> None: ... + def show(self) -> None: ... + def top(self) -> None: ... + def userptr(self) -> object: ... + def window(self) -> window: ... + +def bottom_panel() -> panel: ... +def new_panel(win: window, /) -> panel: ... +def top_panel() -> panel: ... +def update_panels() -> panel: ... diff --git a/stdlib/curses/panel.pyi b/stdlib/curses/panel.pyi index d94f76635..861559d38 100644 --- a/stdlib/curses/panel.pyi +++ b/stdlib/curses/panel.pyi @@ -1,22 +1 @@ -from _curses import window - -version: str - -class _Curses_Panel: # type is (note the space in the class name) - def above(self) -> _Curses_Panel: ... - def below(self) -> _Curses_Panel: ... - def bottom(self) -> None: ... - def hidden(self) -> bool: ... - def hide(self) -> None: ... - def move(self, y: int, x: int) -> None: ... - def replace(self, win: window) -> None: ... - def set_userptr(self, obj: object) -> None: ... - def show(self) -> None: ... - def top(self) -> None: ... - def userptr(self) -> object: ... - def window(self) -> window: ... - -def bottom_panel() -> _Curses_Panel: ... -def new_panel(win: window, /) -> _Curses_Panel: ... -def top_panel() -> _Curses_Panel: ... -def update_panels() -> _Curses_Panel: ... +from _curses_panel import *