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

* adding ascii, panal and textpad modules to the curses module.

* added curses/panel.pyi and curses/textpad.pyi to test/pytype_blacklist.txt
just like curses/__init__.pyi because they all import _curses. (This
may not be the right thing to do)
This commit is contained in:
gossrock
2018-01-26 22:39:55 +00:00
committed by Jelle Zijlstra
parent 372b541a07
commit 79e0b94ef1
4 changed files with 95 additions and 0 deletions

62
stdlib/3/curses/ascii.pyi Normal file
View File

@@ -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
stdlib/3/curses/panel.pyi Normal file
View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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