B 5 R@sbdZddlTddlZddlZddZddZyeWn e k rTdd lmZYnXd 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() ... )*NcCstddl}ddl}ttjddtjd| }x:|j D],\}}|dddks`|dkr@t |||q@W|S)NrZTERMunknown)ZtermfdZACS_)ZLINESZCOLS) _cursescursesZ setupterm_osenvironget_sys __stdout__filenoinitscr__dict__itemssetattr)rrstdscrkeyvaluer2/opt/alt/python37/lib/python3.7/curses/__init__.pyrsrcCs@ddl}ddl}|}t|dr*|j|_t|dr<|j|_|S)NrCOLORS COLOR_PAIRS)rr start_colorhasattrrr)rrZretvalrrrr*s  r)has_keyc Os|r|^}}n$d|kr"|d}ntdt|zDt}tt|dy tWn YnX||f||Sdtkr|dt t t XdS)aWrapper 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 %drNrr) pop TypeErrorlenrZnoechoZcbreakZkeypadrlocalsZechoZnocbreakZendwin)argskwdsrrrrrwrapper?s*       r$) __doc__rosrsysr rrr NameErrorr$rrrr s