ó
ËäNc           @   sU  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d e f d „  ƒ  YZ d \ Z Z	 Z
 Z d d d	 „  ƒ  YZ d
 e e f d „  ƒ  YZ d e j k rÇ e j d d k rÇ d Z n d Z d „  Z e d k rQe ƒ  e ƒ  Z e j e d ƒ e j ƒ  e j d ƒ Z e j d ƒ Z e j ƒ  e j GHe j GHe GHe GHn  d S(   iÿÿÿÿNt   DebconfErrorc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyR        s   t   lowt   mediumt   hight   criticalt   Debconfc           B   sY   e  Z d d d d  „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   c         C   se   x! d j  ƒ  D] } |  j | ƒ q W| p0 t j |  _ | pB t j |  _ t j t _ |  j | ƒ d  S(   Ns©   capb set reset title input beginblock endblock go get register unregister subst fset fget previous_module visible purge metaget exist version settitle info progress data(	   t   splitt
   setCommandt   syst   stdint   readt   stdoutt   writet   stderrt   setUp(   t   selft   titleR   R   t   command(    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt   __init__'   s    c         C   sm   |  j  d ƒ |  _  |  j  d  d k r> t d d |  j  ƒ ‚ n  |  j ƒ  j ƒ  |  _ | ri |  j | ƒ n  d  S(   Ni   s   2.i   s   wrong version: %s(   t   versionR    t   capbR   t   capabilitiesR   (   R   R   (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyR   2   s    c            s    t  ˆ  ˆ ‡ ‡  f d †  ƒ d  S(   Nc             s   ˆ j  ˆ  |  | Ž S(   N(   R   (   t   argst   kw(   R   R   (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt   <lambda><   s    (   t   setattr(   R   R   (    (   R   R   s+   /usr/lib/python2.7/dist-packages/debconf.pyR	   :   s    	c   	      G   s  | j  ƒ  } |  j j d | d j t t | ƒ ƒ f ƒ |  j j ƒ  xX t rŸ y |  j j ƒ  j	 d ƒ } PWqH t
 k
 r› } | j t j k r• qH qœ ‚  qH XqH Wd | k rÇ | j d d ƒ \ } } n | d } } t | ƒ } | d k rð | S| d k r|d } xs t j d | ƒ D]_ } | j d ƒ rjt | ƒ d	 k rj| d d
 k rY| d 7} qt| | d 7} q| | 7} qW| St | | ƒ ‚ d  S(   Ns   %s %s
t    s   
i   t    i    s   (\\.)s   \i   t   n(   t   upperR   t   joint   mapt   strt   flusht   TrueR   t   readlinet   rstript   IOErrort   errnot   EINTRR   t   intt   ret
   startswitht   lenR    (	   R   R   t   paramst   respt   et   statust   datat	   unescapedt   chunk(    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyR   >   s6    ,	!c         C   s!   |  j  j  d ƒ |  j  j ƒ  d  S(   Ns   STOP
(   R   R#   (   R   (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt   stopb   s    c         C   sK   y |  j  | | ƒ d SWn, t k
 rF } | j d d k rG ‚  qG n Xd S(   Ni   i    i   (   t   inputR    R   (   R   t   priorityt   questionR0   (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt
   forceInputf   s    
c         C   s   |  j  | ƒ } | d k S(   Nt   true(   t   get(   R   R8   t   result(    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt
   getBooleano   s    c         C   s   |  j  | ƒ S(   N(   R;   (   R   R8   (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt	   getStrings   s    N(   R   R   t   NoneR   R   R	   R   R5   R9   R=   R>   (    (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyR   %   s   			$				t   DebconfCommunicatorc           B   s)   e  Z d e d  „ Z d „  Z d „  Z RS(   c         C   s»   d d | g } t  j | d t  j d t  j d t ƒ|  _ t t |  ƒ j d | d |  j j d |  j j	 ƒ | r· t
 j
 |  j j ƒ  t
 j t
 j ƒ t
 j
 |  j j ƒ  t
 j t
 j ƒ n  d  S(	   Ns   debconf-communicates   -fnoninteractiveR   R   t	   close_fdsR   R   R   (   t
   subprocesst   Popent   PIPER$   t   dccommt   superR@   R   R   R   t   fcntlR   t   filenot   F_SETFDt
   FD_CLOEXECR   (   R   t   ownerR   t   cloexecR   (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyR   x   s    *"c         C   sL   |  j  d  k	 rH |  j  j j ƒ  |  j  j j ƒ  |  j  j ƒ  d  |  _  n  d  S(   N(   RE   R?   R   t   closeR   t   wait(   R   (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt   shutdown‚   s
    c         C   s&   y |  j  ƒ  Wn t k
 r! n Xd  S(   N(   RO   t   AttributeError(   R   (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt   __del__Š   s    N(   R   R   R?   t   FalseR   RO   RQ   (    (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyR@   w   s   
	t   DEBCONF_USE_CDEBCONFR   s   /usr/lib/cdebconf/debconfs   /usr/share/debconf/frontendc           C   sC   d t  j k r? d t  j d <t  j t t t j g t j ƒ n  d  S(   Nt   DEBIAN_HAS_FRONTENDt   1t   PERL_DL_NONLAZY(   t   ost   environt   execvt   _frontEndProgramR
   t
   executablet   argv(    (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt   runFrontEnd—   s    t   __main__s&   bsdmainutils/calendar_lib_is_not_emptys   less/add_mime_handlers   apt-listchanges/email-address(   R   R   R   R   (    (   R
   RW   R(   R+   RB   RG   t	   ExceptionR    t   LOWt   MEDIUMt   HIGHt   CRITICALR   t   objectR@   RX   RZ   R]   R   t   dbR9   t   goR=   t   lessR>   t   aptlcR5   R   R   (    (    (    s+   /usr/lib/python2.7/dist-packages/debconf.pyt   <module>   s2   R			

