U
    g                     @   sh   d Z ddlT ddlZddlZdd Zdd Zze W n  e	k
rT   dd	lmZ Y nX d
d Z
de
_dS )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   sp   dd l } dd l}ttjddtj d | 	 }| j
 D ],\}}|dd dks^|dkr>t||| q>|S )Nr   ZTERMunknown)Ztermfd   ZACS_)ZLINESZCOLS)_cursescursesZ	setupterm_osenvironget_sys
__stdout__filenoinitscr__dict__itemssetattr)r   r   stdscrkeyvalue r   %/usr/lib/python3.8/curses/__init__.pyr      s    r   c                  C   s@   dd l } dd l}|  }t| dr*| j|_t| dr<| j|_|S )Nr   COLORSCOLOR_PAIRS)r   r   start_colorhasattrr   r   )r   r   Zretvalr   r   r   r   *   s    

r      )has_keyc               	   O   s   | r| ^}} n<d|kr:| d}ddl}|jdtdd ntdt|  zHt }t  t  |d	 z
t  W n   Y nX ||f| |W S dt kr|d t  t	  t
  X dS )
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().
    funcr   Nz0Passing 'func' as keyword argument is deprecated   )
stacklevelz7wrapper expected at least 1 positional argument, got %dr   r   )popwarningswarnDeprecationWarning	TypeErrorlenlocalsZkeypadZechoZnocbreakZendwinr   ZnoechoZcbreakr   )argskwdsr   r!   r   r   r   r   wrapper?   s6    

 



r)   z(func, /, *args, **kwds))__doc__r   osr   sysr   r   r   r   	NameErrorr)   __text_signature__r   r   r   r   <module>   s   
2