
    Rh)                     b    d Z ddl ddlZddlZd Zd Z	 e d Z
y# e	$ r ddlmZ Y d Z
yw xY w)	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                  <   dd l } dd l}t        t        j                  j                  dd      t        j                  j                                | j                         }| j                  j                         D ]  \  }}|dd dk(  s|dv st        |||       ! |S )Nr   TERMunknown)termfd   ACS_)LINESCOLS)_cursescurses	setupterm_osenvironget_sys
__stdout__filenoinitscr__dict__itemssetattr)r   r   stdscrkeyvalues        &/usr/lib/python3.12/curses/__init__.pyr   r      s     3;;??695'')+__F&&,,. (
Uq8v(9!9FC'( M    c                      dd l } dd l}| j                         }t        | d      r| j                  |_        t        | d      r| j
                  |_        |S )Nr   COLORSCOLOR_PAIRS)r   r   start_colorhasattrr    r!   )r   r   retvals      r   r"   r"   *   sE      "Fw!w&$00Mr      )has_keyc                   	 t               }t                t                |j                  d       	 t	                 | |g|i |dt               v r0|j                  d       t                t                t                S S #  Y LxY w# dt               v r0j                  d       t                t                t                w w xY w)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().
    r%   r   r   )	r   noechocbreakkeypadr"   localsechonocbreakendwin)funcargskwdsr   s       r   wrapperr2   ?   s     	
 	a	M F*T*T* vxMM!FJH	  	
 vxMM!FJH	  s!   /B 
B B BB >C	)__doc__r   osr   sysr   r   r"   r&   	NameErrorr2    r   r   <module>r8      sE   
   "!&  ! &!s    ..