Skip to content

adding curses.ascii, curses.panel and curses.textpad modules #1792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 26, 2018
62 changes: 62 additions & 0 deletions stdlib/3/curses/ascii.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from typing import List, Union, overload, TypeVar

_Ch = TypeVar('_Ch', 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

controlnames: List[int]

def isalnum(c: Union[str, int]) -> bool: ...
def isalpha(c: Union[str, int]) -> bool: ...
def isascii(c: Union[str, int]) -> bool: ...
def isblank(c: Union[str, int]) -> bool: ...
def iscntrl(c: Union[str, int]) -> bool: ...
def isdigit(c: Union[str, int]) -> bool: ...
def isgraph(c: Union[str, int]) -> bool: ...
def islower(c: Union[str, int]) -> bool: ...
def isprint(c: Union[str, int]) -> bool: ...
def ispunct(c: Union[str, int]) -> bool: ...
def isspace(c: Union[str, int]) -> bool: ...
def isupper(c: Union[str, int]) -> bool: ...
def isxdigit(c: Union[str, int]) -> bool: ...
def isctrl(c: Union[str, int]) -> bool: ...
def ismeta(c: Union[str, int]) -> bool: ...
def ascii(c: _Ch) -> _Ch: ...
def ctrl(c: _Ch) -> _Ch: ...
def alt(c: _Ch) -> _Ch: ...
def unctrl(c: Union[str, int]) -> str: ...
20 changes: 20 additions & 0 deletions stdlib/3/curses/panel.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from _curses import _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: ...
11 changes: 11 additions & 0 deletions stdlib/3/curses/textpad.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from _curses import _CursesWindow
from typing import Callable, Union

def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ...

class Textbox:
stripspaces: bool
def __init__(self, w: _CursesWindow, insert_mode: bool= ...) -> None: ...
def edit(self, validate: Callable[[int], int]) -> str: ...
def do_command(self, ch: Union[str, int]) -> None: ...
def gather(self) -> str: ...
2 changes: 2 additions & 0 deletions tests/pytype_blacklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ stdlib/3/concurrent/futures/__init__.pyi # parse only
stdlib/3/concurrent/futures/process.pyi # parse only
stdlib/3/concurrent/futures/thread.pyi # parse only
stdlib/3/curses/__init__.pyi # parse only
stdlib/3/curses/panel.pyi # parse only
stdlib/3/curses/textpad.pyi # parse only
stdlib/3/email/__init__.pyi # parse only
stdlib/3/email/contentmanager.pyi # parse only
stdlib/3/email/encoders.pyi # parse only
Expand Down