grthtrhthjhtyjytjytkergtrhtrjytjerhrfh3 \& ã @sbdZddlTddlZddlZdd„Zdd„ZyeWn e k rTdd lmZYnXd d „Z dS) zØcurses 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}ttjjddƒtjjƒd�|j ƒ}x:|j j ƒD],\}}|dd…dks`|d kr@t |||ƒq@W|S) NrZTERMÚunknown)ZtermÚfdéZACS_ÚLINESÚCOLS)rr) Ú_cursesÚcursesZ setuptermÚ_osÚenvironÚgetÚ_sysÚ __stdout__ÚfilenoÚinitscrÚ__dict__ÚitemsÚsetattr)rr ÚstdscrÚkeyÚvalue©rú'/usr/lib64/python3.6/curses/__init__.pyrsrcCs@ddl}ddl}|jƒ}t|dƒr*|j|_t|dƒr<|j|_|S)NrÚCOLORSÚ COLOR_PAIRS)rr Ú start_colorÚhasattrrr)rr Zretvalrrrr*s  ré)Úhas_keycOsrzDtƒ}tƒtƒ|jdƒy tƒWn YnX||f|ž|ŽSdtƒkrl|jdƒtƒ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(). rNrr) rZnoechoZcbreakZkeypadrÚlocalsZechoZnocbreakZendwin)ÚfuncÚargsÚkwdsrrrrÚwrapper?s    r#) Ú__doc__rÚosr Úsysr rrrÚ NameErrorr#rrrrÚ s