B
5R @ sb d Z ddlT ddlZddlZdd Zdd Zye W n e k
rT dd lmZ Y nX d
d Z
dS )zcurses
The main package for curses support for Python. Normally used by importing
the package, and perhaps a particular module inside it.
import curses
from curses import textpad
curses.initscr()
...
)*Nc C st dd l } dd l}ttjddtj d | }x:| j
D ],\}}|dd dks`|dkr@t||| q@W |S )Nr ZTERMunknown)Ztermfd ZACS_)ZLINESZCOLS)
_cursescursesZ setupterm_osenvironget_sys
__stdout__filenoinitscr__dict__itemssetattr)r r stdscrkeyvalue r 4/opt/alt/python37/lib64/python3.7/curses/__init__.pyr s r c C s@ dd l } dd l}| }t| dr*| j|_t| dr<| j|_|S )Nr COLORSCOLOR_PAIRS)r r start_colorhasattrr r )r r Zretvalr r r r * s
r )has_keyc O s | r| ^}} n$d|kr"| d}ntdt| zDt }t t |d y
t W n Y nX ||f| |S dt kr|d t t
t X dS )a Wrapper function that initializes curses and calls another function,
restoring normal keyboard/screen behavior on error.
The callable object 'func' is then passed the main window 'stdscr'
as its first argument, followed by any other arguments passed to
wrapper().
funcz7wrapper expected at least 1 positional argument, got %dr Nr r )pop TypeErrorlenr ZnoechoZcbreakZkeypadr localsZechoZnocbreakZendwin)argskwdsr r r r r wrapper? s*
r$ )__doc__r osr sysr r r r NameErrorr$ r r r r