Rh) bdZddlddlZddlZdZdZ edZ y#e $r ddlmZYdZ ywxYw) 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<ddl}ddl}ttjj ddt jj|j}|jjD]\}}|dddk(s|dvst|||!|S)NrTERMunknown)termfdACS_)LINESCOLS) _cursescurses setupterm_osenvironget_sys __stdout__filenoinitscr__dict__itemssetattr)r rstdscrkeyvalues &/usr/lib/python3.12/curses/__init__.pyrrs3;;??695'')+ __ F&&,,.( U q8v (9!9 FC '( Mcddl}ddl}|j}t|dr|j|_t|dr|j |_|S)NrCOLORS COLOR_PAIRS)r r start_colorhasattrr r!)r rretvals rr"r"*sE  "Fw! w &$00 Mr)has_keyc t}tt|jd t ||g|i|dt vr0|jdt ttSS#YLxYw#dt vr0jdt ttwwxYw)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(). r%rr) rnoechocbreakkeypadr"localsechonocbreakendwin)funcargskwdsrs rwrapperr2?s   a   MF*T*T* vx  MM!  F J H    vx  MM!  F J H s!/B B B BB >C ) __doc__r osrsysrrr"r& NameErrorr2rrr8sE  "! &! &!s  ..