Remove Windows checks from curses (#11241)

Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Ryan McCampbell
2024-04-06 07:12:48 -07:00
committed by GitHub
parent 4a33b2f3a0
commit 5e2f741209
6 changed files with 652 additions and 653 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,22 @@
import sys
from _curses import *
from _curses import _CursesWindow as _CursesWindow
from collections.abc import Callable
from typing import TypeVar
from typing_extensions import Concatenate, ParamSpec
if sys.platform != "win32":
from _curses import *
from _curses import _CursesWindow as _CursesWindow
# NOTE: The _curses module is ordinarily only available on Unix, but the
# windows-curses package makes it available on Windows as well with the same
# contents.
_T = TypeVar("_T")
_P = ParamSpec("_P")
_T = TypeVar("_T")
_P = ParamSpec("_P")
# available after calling `curses.initscr()`
LINES: int
COLS: int
# available after calling `curses.initscr()`
LINES: int
COLS: int
# available after calling `curses.start_color()`
COLORS: int
COLOR_PAIRS: int
# available after calling `curses.start_color()`
COLORS: int
COLOR_PAIRS: int
def wrapper(func: Callable[Concatenate[_CursesWindow, _P], _T], /, *arg: _P.args, **kwds: _P.kwargs) -> _T: ...
def wrapper(func: Callable[Concatenate[_CursesWindow, _P], _T], /, *arg: _P.args, **kwds: _P.kwargs) -> _T: ...

View File

@@ -1,63 +1,62 @@
import sys
from typing import TypeVar
if sys.platform != "win32":
_CharT = TypeVar("_CharT", str, int)
_CharT = TypeVar("_CharT", str, int)
NUL: int
SOH: int
STX: int
ETX: int
EOT: int
ENQ: int
ACK: int
BEL: int
BS: int
TAB: int
HT: int
LF: int
NL: int
VT: int
FF: int
CR: int
SO: int
SI: int
DLE: int
DC1: int
DC2: int
DC3: int
DC4: int
NAK: int
SYN: int
ETB: int
CAN: int
EM: int
SUB: int
ESC: int
FS: int
GS: int
RS: int
US: int
SP: int
DEL: int
NUL: int
SOH: int
STX: int
ETX: int
EOT: int
ENQ: int
ACK: int
BEL: int
BS: int
TAB: int
HT: int
LF: int
NL: int
VT: int
FF: int
CR: int
SO: int
SI: int
DLE: int
DC1: int
DC2: int
DC3: int
DC4: int
NAK: int
SYN: int
ETB: int
CAN: int
EM: int
SUB: int
ESC: int
FS: int
GS: int
RS: int
US: int
SP: int
DEL: int
controlnames: list[int]
def isalnum(c: str | int) -> bool: ...
def isalpha(c: str | int) -> bool: ...
def isascii(c: str | int) -> bool: ...
def isblank(c: str | int) -> bool: ...
def iscntrl(c: str | int) -> bool: ...
def isdigit(c: str | int) -> bool: ...
def isgraph(c: str | int) -> bool: ...
def islower(c: str | int) -> bool: ...
def isprint(c: str | int) -> bool: ...
def ispunct(c: str | int) -> bool: ...
def isspace(c: str | int) -> bool: ...
def isupper(c: str | int) -> bool: ...
def isxdigit(c: str | int) -> bool: ...
def isctrl(c: str | int) -> bool: ...
def ismeta(c: str | int) -> bool: ...
def ascii(c: _CharT) -> _CharT: ...
def ctrl(c: _CharT) -> _CharT: ...
def alt(c: _CharT) -> _CharT: ...
def unctrl(c: str | int) -> str: ...
controlnames: list[int]
def isalnum(c: str | int) -> bool: ...
def isalpha(c: str | int) -> bool: ...
def isascii(c: str | int) -> bool: ...
def isblank(c: str | int) -> bool: ...
def iscntrl(c: str | int) -> bool: ...
def isdigit(c: str | int) -> bool: ...
def isgraph(c: str | int) -> bool: ...
def islower(c: str | int) -> bool: ...
def isprint(c: str | int) -> bool: ...
def ispunct(c: str | int) -> bool: ...
def isspace(c: str | int) -> bool: ...
def isupper(c: str | int) -> bool: ...
def isxdigit(c: str | int) -> bool: ...
def isctrl(c: str | int) -> bool: ...
def ismeta(c: str | int) -> bool: ...
def ascii(c: _CharT) -> _CharT: ...
def ctrl(c: _CharT) -> _CharT: ...
def alt(c: _CharT) -> _CharT: ...
def unctrl(c: str | int) -> str: ...

View File

@@ -1,4 +1 @@
import sys
if sys.platform != "win32":
def has_key(ch: int | str) -> bool: ...
def has_key(ch: int | str) -> bool: ...

View File

@@ -1,25 +1,22 @@
import sys
from _curses import _CursesWindow
if sys.platform != "win32":
from _curses import _CursesWindow
version: str
version: str
class _Curses_Panel: # type is <class '_curses_panel.curses panel'> (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: _CursesWindow) -> None: ...
def set_userptr(self, obj: object) -> None: ...
def show(self) -> None: ...
def top(self) -> None: ...
def userptr(self) -> object: ...
def window(self) -> _CursesWindow: ...
class _Curses_Panel: # type is <class '_curses_panel.curses panel'> (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: _CursesWindow) -> None: ...
def set_userptr(self, obj: object) -> None: ...
def show(self) -> None: ...
def top(self) -> None: ...
def userptr(self) -> object: ...
def window(self) -> _CursesWindow: ...
def bottom_panel() -> _Curses_Panel: ...
def new_panel(win: _CursesWindow, /) -> _Curses_Panel: ...
def top_panel() -> _Curses_Panel: ...
def update_panels() -> _Curses_Panel: ...
def bottom_panel() -> _Curses_Panel: ...
def new_panel(win: _CursesWindow, /) -> _Curses_Panel: ...
def top_panel() -> _Curses_Panel: ...
def update_panels() -> _Curses_Panel: ...

View File

@@ -1,13 +1,11 @@
import sys
from _curses import _CursesWindow
from collections.abc import Callable
if sys.platform != "win32":
from _curses import _CursesWindow
def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ...
def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ...
class Textbox:
stripspaces: bool
def __init__(self, win: _CursesWindow, insert_mode: bool = False) -> None: ...
def edit(self, validate: Callable[[int], int] | None = None) -> str: ...
def do_command(self, ch: str | int) -> None: ...
def gather(self) -> str: ...
class Textbox:
stripspaces: bool
def __init__(self, win: _CursesWindow, insert_mode: bool = False) -> None: ...
def edit(self, validate: Callable[[int], int] | None = None) -> str: ...
def do_command(self, ch: str | int) -> None: ...
def gather(self) -> str: ...