
9)-Uc           @@ s'  d  d l  m Z m Z d  d l m Z y d  d l Z e j e Z Wn e	 e
 f k
 rb e Z n Xd  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l m Z m Z d  d l Z e j d k r d  d l Z d   Z n	 d   Z e d g  Z d	 Z d
 e f d     YZ d e f d     YZ d e j f d     YZ d e  f d     YZ! d e j" f d     YZ# d e# f d     YZ$ d e% f d     YZ& d e  f d     YZ' d e% f d     YZ( d e  f d     YZ) d e$ f d     YZ* d  e* f d!     YZ+ d" e+ f d#     YZ, d$ e+ f d%     YZ- d& e* f d'     YZ. d( e* f d)     YZ/ d* e, e) f d+     YZ0 d, e$ e) f d-     YZ1 d. e2 f d/     YZ3 d0 e j4 d0 d1  f d2     YZ5 e j6 e3  d3 e  f d4     Y Z7 d5 e8 f d6     YZ9 e9 Z: d S(7   i    (   t   absolute_importt   print_function(   t   function_deprecated_byN(   t   BytesIOt   StringIOt   3c         C@ sJ   t  |  t j  s t Sy |  j   t SWn t t j f k
 rE t SXd  S(   N(   t
   isinstancet   iot   IOBaset   Falset   filenot   Truet   AttributeErrort   UnsupportedOperation(   t   f(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   _is_real_file3   s    
c         C@ s   t  |  t  o t |  d  S(   NR
   (   R   t   filet   hasattr(   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   <   s    s&   /usr/share/keyrings/debian-keyring.gpgs   /usr/bin/gpgvt   Errorc           B@ s   e  Z d  Z RS(   s0   Base class for custom exceptions in this module.(   t   __name__t
   __module__t   __doc__(    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   D   s   t   RestrictedFieldErrorc           B@ s   e  Z d  Z RS(   s>   Raised when modifying the raw value of a field is not allowed.(   R   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   H   s   t   TagSectionWrapperc           B@ s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   Wrap a TagSection object, using its find_raw method to get field values

    This allows us to pick which whitespace to strip off the beginning and end
    of the data, so we don't lose leading newlines.
    c         C@ s   | |  _  d  S(   N(   t   _TagSectionWrapper__section(   t   selft   section(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __init__S   s    c         c@ s5   x. |  j  j   D] } | j d  s | Vq q Wd  S(   Nt   #(   R   t   keyst
   startswith(   R   t   key(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __iter__V   s    c         C@ s5   t  g  |  j j   D] } | j d  s | ^ q  S(   NR   (   t   lenR   R   R   (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __len__[   s    c         C@ sZ   |  j  j |  } | d  k r- t |   n  | | j d  d } | j d  j d  S(   Nt   :i   s    	s   
(   R   t   find_rawt   Nonet   KeyErrort   findt   lstript   rstrip(   R   R   t   st   data(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __getitem___   s
    (   R   R   R   R   R    R"   R,   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   L   s
   			t
   OrderedSetc           B@ sV   e  Z d  Z g  d  Z d   Z d   Z d   Z d   Z d   Z e Z	 d   Z
 RS(   s   A set-like object that preserves order when iterating over it

    We use this to keep track of keys in Deb822Dict, because it's much faster
    to look up if a key is in a set than in a list.
    c         C@ s7   t    |  _ g  |  _ x | D] } |  j |  q Wd  S(   N(   t   sett   _OrderedSet__sett   _OrderedSet__ordert   add(   R   t   iterablet   item(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   u   s    	c         C@ s3   | |  k r/ |  j  j |  |  j j |  n  d  S(   N(   R/   R1   R0   t   append(   R   R3   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR1   {   s    c         C@ s$   |  j  j |  |  j j |  d  S(   N(   R/   t   removeR0   (   R   R3   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR5      s    c         C@ s   t  |  j  S(   N(   t   iterR0   (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR       s    c         C@ s   t  |  j  S(   N(   R!   R0   (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR"      s    c         C@ s   | |  j  k S(   N(   R/   (   R   R3   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __contains__   s    c         C@ s"   x | D] } |  j  |  q Wd  S(   N(   R1   (   R   R2   R3   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   extend   s    (   R   R   R   R   R1   R5   R    R"   R7   R4   R8   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR-   n   s   					t
   Deb822Dictc           B@ s   e  Z d  Z d d d d d  Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z e j d
 k  rx e Z n  d   Z d   Z d Z d   Z RS(   s3  A dictionary-like object suitable for storing RFC822-like data.

    Deb822Dict behaves like a normal dict, except:
        - key lookup is case-insensitive
        - key order is preserved
        - if initialized with a _parsed parameter, it will pull values from
          that dictionary-like object as needed (rather than making a copy).
          The _parsed dict is expected to be able to handle case-insensitive
          keys.

    If _parsed is not None, an optional _fields parameter specifies which keys
    in the _parsed dictionary are exposed.
    s   utf-8c         C@ s]  i  |  _  t   |  _ d  |  _ | |  _ | d  k	 r t | d  rQ | j   } n t |  } y% x | D] \ } } | |  | <qg WWq t	 k
 r t
 |  j  } t
 | |  }	 t	 d | |	 f   q Xn  | d  k	 rY| |  _ | d  k r|  j j g  |  j D] } t |  ^ q qY|  j j g  | D]! }
 |
 |  j k r.t |
  ^ q. n  d  S(   Nt   itemssC   dictionary update sequence element #%d has length %d; 2 is required(   t   _Deb822Dict__dictR-   t   _Deb822Dict__keysR%   t   _Deb822Dict__parsedt   encodingR   R:   t   listt
   ValueErrorR!   R8   t   _strI(   R   t   _dictt   _parsedt   _fieldsR>   R:   t   kt   vt   thist   len_R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR      s*    				/c         C@ s   t  | t  r y | j |  j  SWq t k
 r } t j d |  j t  t j	 |  } y | j | d  SWn t k
 r |  q X| d |  _ q Xn | Sd S(   s9   If value is not already Unicode, decode it intelligently.s?   decoding from %s failed; attempting to detect the true encodingR>   N(
   R   t   bytest   decodeR>   t   UnicodeDecodeErrort   warningst   warnt   UnicodeWarningt   chardett   detect(   R   t   valuet   et   result(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   _detect_encoding   s    	
c         c@ s#   x |  j  D] } t |  Vq
 Wd  S(   N(   R<   t   str(   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR       s    c         C@ s   t  |  j  S(   N(   R!   R<   (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR"      s    c         C@ s-   t  |  } |  j j |  | |  j | <d  S(   N(   RA   R<   R1   R;   (   R   R   RQ   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __setitem__   s    c         C@ so   t  |  } y |  j | } WnB t k
 ra |  j d  k	 r[ | |  j k r[ |  j | } qb   n X|  j |  S(   N(   RA   R;   R&   R=   R%   R<   RT   (   R   R   RQ   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR,      s    c         C@ sB   t  |  } |  j j |  y |  j | =Wn t k
 r= n Xd  S(   N(   RA   R<   R5   R;   R&   (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __delitem__  s    c         C@ s   t  |  } | |  j k S(   N(   RA   R<   (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR7     s    R   c         C@ s:   d d j  g  |  j   D] \ } } d | | f ^ q  S(   Ns   {%s}s   , s   %r: %r(   t   joinR:   (   R   RE   RF   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __repr__  s    c         C@ sU   t  |   } t  |  } | | k s( t Sx& | D] } |  | | | k r/ t Sq/ Wt S(   N(   t   sortedR	   R   (   R   t   othert   mykeyst	   otherkeysR   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __eq__  s    c         C@ s   |  j  |   } | S(   N(   t	   __class__(   R   t   copy(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR`   *  s    N(   R   R   R   R%   R   RT   R    R"   RV   R,   RW   R7   t   syst   versiont   has_keyRY   R^   t   __hash__R`   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR9      s    							
				t   Deb822c           B@ s:  e  Z d d d d  d  Z e d e e d  d   Z e d    Z d d  Z	 d   Z
 d   Z e j d k r~ d   Z n  d	   Z d d e d
  Z d   Z e e  Z d   Z e e  Z d   Z e e  Z d d  Z e e  Z d   Z e e  Z d   Z e e  Z d d  Z d   Z d   Z RS(   s   utf-8c      
   C@ s   t  | d  r | } d } n d } t j |  d | d | d | d | | d k	 r y |  j | |  Wq t k
 r| q Xn  d |  _ d S(   s  Create a new Deb822 instance.

        :param sequence: a string, or any any object that returns a line of
            input each time, normally a file.  Alternately, sequence can
            be a dict that contains the initial key-value pairs.

        :param fields: if given, it is interpreted as a list of fields that
            should be parsed (the rest will be discarded).

        :param _parsed: internal parameter.

        :param encoding: When parsing strings, interpret them in this encoding.
            (All values are given back as unicode objects, so an encoding is
            necessary in order to properly interpret the strings.)
        R:   RB   RC   RD   R>   N(   R   R%   R9   R   t   _internal_parsert   EOFErrort   gpg_info(   R   t   sequencet   fieldsRC   R>   RB   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   4  s    	c         c@ s   t  r | r t |  r i  } t j d k r: t | d <n  t j | |  } x | D]5 } |  d | d t |  d |  }	 |	 rS |	 VqS qS Wn^ t | t	 j
  r | j   } n  t |  }
 x. t r |  |
 | d | } | s Pn  | Vq Wd S(   s*  Generator that yields a Deb822 object for each paragraph in sequence.

        :param sequence: same as in __init__.

        :param fields: likewise.

        :param use_apt_pkg: if sequence is a file, apt_pkg can be used
            if available to parse the file, since it's much much faster.  Set
            this parameter to True to enable use of apt_pkg. Note that the
            TagFile parser from apt_pkg is a much stricter parser of the
            Deb822 format, particularly with regards whitespace between
            paragraphs and comments within paragraphs. If these features are
            required (for example in debian/control files), ensure that this
            parameter is set to False.
        :param shared_storage: not used, here for historical reasons.  Deb822
            objects never use shared storage anymore.
        :param encoding: Interpret the paragraphs in this encoding.
            (All values are given back as unicode objects, so an encoding is
            necessary in order to properly interpret the strings.)
        R   RI   Rj   RC   R>   N(   t   _have_apt_pkgR   Ra   Rb   R   t   apt_pkgt   TagFileR   R   t   sixt   string_typest
   splitlinesR6   (   t   clsRi   Rj   t   use_apt_pkgt   shared_storageR>   t   kwargst   parserR   t	   paragraphR2   t   x(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   iter_paragraphsV  s&    		c         c@ s   t  } x |  D] } t | t  r: | j d  rO q qO n | j d  rO q n  | r t | t  r| | j d  s q q n | j d  s q n  t } n  | Vq Wd S(   sy   Yields only lines that do not begin with '#'.

        Also skips any blank lines at the beginning of the input.
        R   s   
N(   R   R   RI   R   R)   R	   (   Ri   t   at_beginningt   line(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   _skip_useless_lines  s    			c         @ s  d } t  j | d  } t  j | d  } t  j d  }   f d   } t | t j t f  rq | j   } n  d  } d }	 x)|  j |  j	 |   D]}
 |  j
 |
  }
 | j |
  } | r| r |	 |  | <n  | | j d   s d  } q n  | j d  } | j d  }	 q n  | j |
  } | r|| r@|	 |  | <n  | | j d   sad  } q n  | j d  } d }	 q n  | j |
  } | r |	 d	 |
 7}	 q q q W| r|	 |  | <n  d  S(
   Ns!   ^(?P<key>[^: \t\n\r\f\v]+)\s*:\s*s   (?P<data>\S.*?)\s*$t   $s   ^\s(?P<data>.+?)\s*$c         @ s     d  k p |    k S(   N(   R%   (   R   (   Rj   (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   <lambda>  s    t    R   R+   s   
(   t   ret   compileR   Rn   Ro   RI   Rp   R%   t   gpg_stripped_paragraphR{   RT   t   matcht   group(   R   Ri   Rj   t   key_partt   singlet   multit	   multidatat   wanted_fieldt   curkeyt   contentRz   t   m(    (   Rj   s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRf     sL    	
c         C@ s
   |  j    S(   N(   t   dump(   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __str__  s    c         C@ s
   |  j    S(   N(   R   (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __unicode__  s    R   c         C@ s   |  j    j |  j  S(   N(   R   t   encodeR>   (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt	   __bytes__  s    c         C@ s   t  j |  |  S(   s   Return the self[key] as a string (or unicode)

        The default implementation just returns unicode(self[key]); however,
        this can be overridden in subclasses (e.g. _multivalued) that can take
        special values.
        (   Rn   t	   text_type(   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   get_as_string  s    c         C@ s   | d k r t   } t } n t } | d k r< |  j } n  x |  D] } |  j |  } | so | d d k r d | | f } n d | | f } | r | r | j | j |   qC | j |  qC W| r | j   Sd S(   s  Dump the the contents in the original format

        If fd is None, returns a unicode object.  Otherwise, fd is assumed to
        be a file-like object, and this method will write the data to it
        instead of returning a unicode object.

        If fd is not none and text_mode is False, the data will be encoded
        to a byte string before writing to the file.  The encoding used is
        chosen via the encoding parameter; None means to use the encoding the
        object was initialized with (utf-8 by default).  This will raise
        UnicodeEncodeError if the encoding can't support all the characters in
        the Deb822Dict values.
        i    s   
s   %s:%s
s   %s: %s
N(	   R%   R   R   R	   R>   R   t   writeR   t   getvalue(   R   t   fdR>   t	   text_modet   return_stringR   RQ   t   entry(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s     		c         C@ s   | j  d  r t St Sd  S(   Ns   
(   t   countR	   R   (   R   R*   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   is_single_line#  s    c         C@ s   |  j  |  S(   N(   R   (   R   R*   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   is_multi_line+  s    c         C@ s*  | s
 | S| s | S|  j  |  r |  j  |  r d } | | j d  rT d } n  t | | | j |   } | d } } x8 | d D], } | | k r q n  | | | } | } q W| S|  j |  r |  j |  r x= | j t  D], } | | j t  k r | d | } q q W| St  d  S(   Nt    s   , i    i   s   
(   R   R   RZ   t   splitR   Rp   R   R@   (   R   t   s1t   s2t   delimt   Lt   prevt   mergedR3   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   _merge_fields0  s,    	
c         C@ s   | d  k r |  } | } n | } | } | | k r\ | | k r\ |  j | | | |  } n8 | | k ru | | } n | | k r | | } n t  | d  k r | |  | <d  S| S(   N(   R%   t   _mergeFieldsR&   (   R   R   t   d1t   d2t   x1t   x2R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   merge_fieldsU  s     	
c   
      C@ s  g  } g  } g  } d } t  j d  } t  j d  } t } x|  D]} t j d k rv t | t  rv | j   } n  | j d  } | r | j	 |  r qC q t
 } n  | j	 |  }	 |	 sI| d k r | j	 |  s | j |  qF| sFPqFq| d k r*| j	 |  rd } qF| j |  q| d k r| j |  qqC |	 j d  d	 k rp|	 j d
  } n& |	 j d  d k r| j |  Pn  | j	 |  sC | s| j |  q| j |  qC qC Wt |  r| | | f St d   d S(   s   Return a (gpg_pre, payload, gpg_post) tuple

        Each element of the returned tuple is a list of lines (with trailing
        whitespace stripped).
        t   SAFEs=   ^-----(?P<action>BEGIN|END) PGP (?P<what>[^-]+)-----[\r\t ]*$s   ^\s*$R   s   
s   SIGNED MESSAGEt	   SIGNATUREt   actiont   BEGINt   whatt   ENDs   only blank lines found in inputN(   R   R   R   Ra   Rb   R   RU   R   t   stripR   R	   R4   R   R!   Rg   (
   Ri   t   gpg_pre_linest   linest   gpg_post_linest   statet   gpgret
   blank_linet
   first_lineRz   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   split_gpg_and_payloadv  sP    		c         C@ s   |  j  |  d S(   Ni   (   R   (   Rq   Ri   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s    c         C@ sR   t  |  d  s t d   n  |  j d k rK t j |  j d | |  _ n  |  j S(   s  Return a GpgInfo object with GPG signature information

        This method will raise ValueError if the signature is not available
        (e.g. the original text cannot be found).

        :param keyrings: list of keyrings to use (see GpgInfo.from_sequence)
        t   raw_texts   original text cannot be foundt   keyringsN(   R   R@   Rh   R%   t   GpgInfot   from_sequenceR   (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   get_gpg_info  s    c         C@ sq   | j  d  r t d   n  xL | j   d D]: } | sJ t d   n  | d j   s/ t d   q/ q/ Wd S(   s   Raise ValueError if value is not a valid value for key

        Subclasses that do interesting things for different keys may wish to
        override this method.
        s   
s   value must not end in '\n'i   s   value must not have blank linesi    s$   each line must start with whitespaceN(   t   endswithR@   Rp   t   isspace(   R   R   RQ   Rz   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   validate_input  s    	c         C@ s'   |  j  | |  t j |  | |  d  S(   N(   R   R9   RV   (   R   R   RQ   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRV     s    N(   R   R   R%   R   t   classmethodR	   Rx   t   staticmethodR{   Rf   R   R   Ra   Rb   R   R   R   R   R   t   isSingleLineR   t   isMultiLineR   R   R   t   mergeFieldsR   R   R   R   RV   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRe   2  s8   	!35				1			#	E		R   c           B@ sk   e  Z d  Z d Z d   Z d   Z e d d   Z e d d d	   Z	 e
 d
    Z e d    Z RS(   s%  A wrapper around gnupg parsable output obtained via --status-fd

    This class is really a dictionary containing parsed output from gnupg plus
    some methods to make sense of the data.
    Keys are keywords and values are arguments suitably splitted.
    See /usr/share/doc/gnupg/DETAILS.gzt   GOODSIGt   EXPSIGt	   EXPKEYSIGt	   REVKEYSIGt   BADSIGc         C@ s   d |  k p d |  k S(   s   Is the signature valid?R   t   VALIDSIG(    (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   valid  s    c         C@ s   d S(   s>   Return the primary ID of the signee key, None is not availableN(    (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   uid  s    c   	      C@ s  |    } t  | t j  r- | j d  } n  t  | t j  rQ | j d  } n  | | _ | | _ d } x | D] } | j |  s qp n  | t |  } | j d  } | j	 d  } | |  } | |  j
 k r | | d j d d  } n | | d j d  } | | | <qp W| S(   s   Create a new GpgInfo object from gpg(v) --status-fd output (out) and
        optionally collect stderr as well (err).
        
        Both out and err can be lines in newline-terminated sequence or regular strings.s   
s	   [GNUPG:] R   i   (   R   Rn   Ro   R   t   outt   errR   R!   R   R'   t   uidkeys(	   Rq   R   R   t   nt   headert   lR*   R   RQ   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   from_output  s(    			
c   
   
   C@ s  | p	 t  } | p t g } t |  } | j d d g  x! | D] } | j d | g  qA Wd | k ry t d   n  t j | d t j d t j d t j d t } t	 | t
  r | } n |  j |  } | j |  \ } }	 |  j | j d	  |	 j d	   S(
   s  Create a new GpgInfo object from the given sequence.

        :param sequence: sequence of lines of bytes or a single byte string

        :param keyrings: list of keyrings to use (default:
            ['/usr/share/keyrings/debian-keyring.gpg'])

        :param executable: list of args for subprocess.Popen, the first element
            being the gpgv executable (default: ['/usr/bin/gpgv'])
        s   --status-fdt   1s	   --keyrings'   cannot access any of the given keyringst   stdint   stdoutt   stderrt   universal_newliness   utf-8(   t   GPGV_DEFAULT_KEYRINGSt   GPGV_EXECUTABLER?   R8   t   IOErrort
   subprocesst   Popent   PIPER	   R   RI   t   _get_full_bytest   communicateR   RJ   (
   Rq   Ri   R   t
   executablet   argsRE   t   pt   inpR   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   ,  s"    		c         C@ sd   t  |   } y t |  } Wn t k
 r0 d SXd } | j d  rO d } n  | | | j |  S(   s   Return a byte string from a sequence of lines of bytes.

        This method detects if the sequence's lines are newline-terminated, and
        constructs the byte string appropriately.
        R~   s   
(   R6   t   nextt   StopIterationR   RX   (   Ri   t   sequence_iterR   t   join_str(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   T  s    	c         O@ s/   t  | d   } |  j | | |  SWd QXd S(   s]   Create a new GpgInfo object from the given file.

        See GpgInfo.from_sequence.
        t   rbN(   t   openR   (   Rq   t   targetR   Rt   t   target_file(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt	   from_filef  s    (   s   GOODSIGR   R   R   R   N(   R   R   R   R   R   R   R   R%   R   R   R   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s   		$'t   PkgRelationc           B@ s   e  Z d  Z e j d  Z e j d  Z e j d  Z e j d  Z e j d  Z	 e j d  Z
 e j d d d	 g  Z e j d
 d d g  Z e d    Z e d    Z RS(   s   Inter-package relationships

    Structured representation of the relationships of a package to another,
    i.e. of what can appear in a Deb882 field like Depends, Recommends,
    Suggests, ... (see Debian Policy 7.1).
    s   ^\s*(?P<name>[a-zA-Z0-9.+\-]{2,})(:(?P<archqual>([a-zA-Z0-9][a-zA-Z0-9-]*)))?(\s*\(\s*(?P<relop>[>=<]+)\s*(?P<version>[0-9a-zA-Z:\-+~.]+)\s*\))?(\s*\[(?P<archs>[\s!\w\-]+)\])?\s*((?P<restrictions><.+>))?\s*$s   \s*,\s*s   \s*\|\s*s   \s*s   >\s*<s#   (?P<enabled>\!)?(?P<profile>[^\s]+)t   ArchRestrictiont   enabledt   archt   BuildRestrictiont   profilec         @ s     f d      f d        f d   }   j  j | j    } t   j j |  } g  | D]% } g  | D] } | |  ^ qt ^ qg S(   s|   Parse a package relationship string (i.e. the value of a field like
        Depends, Recommends, Build-Depends ...)
        c         @ sj   g  } x]   j  j |  j    D]C } | d d k } | rH | d } n  | j   j | |   q W| S(   Ni    t   !i   (   t   _PkgRelation__blank_sep_RER   R   R4   R   (   t   rawt   archsR   t   disabled(   Rq   (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   parse_archs  s    c         @ s   g  } x   j  j |  j   j d   D] } g  } xh   j j |  D]T }   j j |  } | rG | j   } | j   j	 | d d k | d   qG qG W| j |  q( W| S(   s]   split a restriction formula into a list of restriction lists

            Each term in the restriction list is a namedtuple of form:

                (enabled, label)

            where
                enabled: boolean: whether the restriction is positive or negative
                profile: the profile name of the term e.g. 'stage1'
            s   <> R   R   R   (
   t    _PkgRelation__restriction_sep_RER   t   lowerR   R   t   _PkgRelation__restriction_RER   t	   groupdictR4   R   (   R   t   restrictionst   rgrpR   t   restrictionR   t   parts(   Rq   (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   parse_restrictions  s    (c         @ s     j  j |   } | r | j   } i | d d 6| d d 6d  d 6d  d 6d  d 6} | d si | d r | d | d f | d <n  | d r  | d  | d <n  | d r  | d  | d <n  | St j d |   i |  d 6d  d 6d  d 6Sd  S(	   Nt   namet   archqualRb   R   R   t   relopR   s8   cannot parse package relationship "%s", returning it raw(   t   _PkgRelation__dep_RER   R   R%   RL   RM   (   R   R   R  t   d(   Rq   R   R  (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt	   parse_rel  s&    


	(   t   _PkgRelation__comma_sep_RER   R   t   mapt   _PkgRelation__pipe_sep_RE(   Rq   R   R
  t   tl_depst   cnft   or_depst   or_dep(    (   Rq   R   R  s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   parse_relations  s    
c         @ sI   d     d       f d     f d   } d j  t | |    S(   s   Format to string structured inter-package relationships
        
        Perform the inverse operation of parse_relations, returning a string
        suitable to be written in a package stanza.
        c         S@ s    d |  j  r d n d |  j f S(   Ns   %s%sR~   R   (   R   R   (   t	   arch_spec(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   pp_arch  s    c         S@ sQ   g  } x7 |  D]/ } | j  d | j r+ d n d | j f  q Wd d j |  S(   Ns   %s%sR~   R   s   <%s>R   (   R4   R   R   RX   (   R   R*   t   term(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   pp_restrictions  s    	c         @ s   |  d } |  j  d  d  k	 r4 | d |  d 7} n  |  j  d  d  k	 rp | d d j t   |  d   7} n  |  j  d  d  k	 r | d d j t  |  d   7} n  | S(	   NR  Rb   s    (%s %s)R   s    [%s]R   R   s    %s(   t   getR%   RX   R  (   t   depR*   (   R  R  (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   pp_atomic_dep  s    
''c         @ s   d j  t   |    S(   Ns    | (   RX   R  (   t   deps(   R  (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR}     s    s   , (   RX   R  (   t   relst	   pp_or_dep(    (   R  R  R  s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRU     s
    		

(   R   R   R   R   R   R  R  R  R   R   R   t   collectionst
   namedtupleR   R   R   R  R   RU   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   p  s   				Dt   _lowercase_dictc           B@ s   e  Z d  Z d   Z RS(   s4   Dictionary wrapper which lowercase keys upon lookup.c         C@ s   t  j |  | j    S(   N(   t   dictR,   R   (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR,     s    (   R   R   R   R,   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR    s   t   _PkgRelationMixinc           B@ s&   e  Z d  Z d   Z e d    Z RS(   sr  Package relationship mixin

    Inheriting from this mixin you can extend a Deb882 object with attributes
    letting you access inter-package relationship in a structured way, rather
    than as strings. For example, while you can usually use pkg['depends'] to
    obtain the Depends string of package pkg, mixing in with this class you
    gain pkg.depends to access Depends as a Pkgrel instance

    To use, subclass _PkgRelationMixin from a class with a _relationship_fields
    attribute. It should be a list of field names for which structured access
    is desired; for each of them a method wild be added to the inherited class.
    The method name will be the lowercase version of field name; '-' will be
    mangled as '_'. The method would return relationships in the same format of
    the PkgRelation' relations property.

    See Packages and Sources as examples.
    c         O@ se   t  i   |  _ t |  _ xF |  j D]; } | j   } | |  k rP d  |  j | <q" g  |  j | <q" Wd  S(   N(   R  t   _PkgRelationMixin__relationsR	   t#   _PkgRelationMixin__parsed_relationst   _relationship_fieldsR   R%   (   R   R   Rt   R  t   keyname(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s    	c         @ sh     j  sa t   f d     j j    } x( | D]  } t j   |    j | <q1 Wt   _  n    j S(   s  Return a dictionary of inter-package relationships among the current
        and other packages.

        Dictionary keys depend on the package kind. Binary packages have keys
        like 'depends', 'recommends', ... while source packages have keys like
        'build-depends', 'build-depends-indep' and so on. See the Debian policy
        for the comprehensive field list.

        Dictionary values are package relationships returned as lists of lists
        of dictionaries (see below for some examples).

        The encoding of package relationships is as follows:
        - the top-level lists corresponds to the comma-separated list of
          Deb822, their components form a conjunction, i.e. they have to be
          AND-ed together
        - the inner lists corresponds to the pipe-separated list of Deb822,
          their components form a disjunction, i.e. they have to be OR-ed
          together
        - member of the inner lists are dictionaries with the following keys:
          - name:       package (or virtual package) name
          - version:    A pair <operator, version> if the relationship is
                        versioned, None otherwise. operator is one of "<<",
                        "<=", "=", ">=", ">>"; version is the given version as
                        a string.
          - arch:       A list of pairs <enabled, arch> if the
                        relationship is architecture specific, None otherwise.
                        Enabled is a boolean (false if the architecture is
                        negated with "!", true otherwise), arch the
                        Debian architecture name as a string.
          - restrictions: A list of lists of tuples <enabled, profile>
                        if there is a restriction formula defined, None
                        otherwise. Each list of tuples represents a restriction
                        list while each tuple represents an individual term
                        within the restriction list. Enabled is a boolean
                        (false if the restriction is negated with "!", true
                        otherwise). The profile is the name of the build
                        restriction.
                        https://wiki.debian.org/BuildProfileSpec

          The arch and restrictions tuples are available as named tuples so
          elements are available as term[0] or alternatively as
          term.enabled (and so forth).

        Examples:

          "emacs | emacsen, make, debianutils (>= 1.7)"     becomes
          [ [ {'name': 'emacs'}, {'name': 'emacsen'} ],
            [ {'name': 'make'} ],
            [ {'name': 'debianutils', 'version': ('>=', '1.7')} ] ]

          "tcl8.4-dev, procps [!hurd-i386]"                 becomes
          [ [ {'name': 'tcl8.4-dev'} ],
            [ {'name': 'procps', 'arch': (false, 'hurd-i386')} ] ]

          "texlive <!cross>"                                becomes
          [ [ {'name': 'texlive',
                    'restriction': [[(false, 'cross')]]} ] ]
        c         @ s     j  |  d  k S(   N(   R"  R%   (   R   (   R   (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR}   c  s    (   R#  t   filterR"  R   R   R  R   (   R   t	   lazy_relsR   (    (   R   s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt	   relations&  s    <	(   R   R   R   R   t   propertyR(  (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR!     s   	t   _multivaluedc           B@ s)   e  Z d  Z d   Z d   Z d   Z RS(   s7  A class with (R/W) support for multivalued fields.

    To use, create a subclass with a _multivalued_fields attribute.  It should
    be a dictionary with *lower-case* keys, with lists of human-readable
    identifiers of the fields as the values.  Please see Dsc, Changes, and
    PdiffIndex as examples.
    c         O@ s   t  j |  | |  x |  j j   D] \ } } y |  | } Wn t k
 rS q# n X|  j |  r} g  |  | <|  | j } n t   |  | <|  | j } x< t	 d  | j    D]% } | t t | | j      q Wq# Wd  S(   N(   Re   R   t   _multivalued_fieldsR:   R&   R   R4   R9   t   updateR&  R%   Rp   t   zipR   (   R   R   Rt   t   fieldRj   t   contentst   updater_methodRz   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   t  s    
c         C@ s/   | j    |  j k r n t j |  | |  d  S(   N(   R   R+  Re   R   (   R   R   RQ   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s    c         C@ s  | j    } | |  j k rvt   } t |  | d  rG |  | g } n  | j t j d   |  | } |  j | } y |  j } Wn t k
 r i  } n Xx | D] } x | D] } t j	 | |  }	 y | | | }
 Wn t
 k
 r |	 } n X|
 t |	  d |	 } d | k r+t d |   n  | j t j d  |  q W| j t j d   q W| j   j d  St j |  |  Sd  S(   NR   s   
R   s5   '\n' not allowed in component of multivalued field %ss    %s(   R   R+  R   R   R   Rn   t   ut   _fixed_field_lengthsR   R   R&   R!   R@   R   R)   Re   R   (   R   R   t   keylR   t   arrayt   ordert   field_lengthsR3   Rw   t	   raw_valuet   lengthRQ   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s6    	


(   R   R   R   R   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR*  k  s   		
t   _gpg_multivaluedc           B@ s&   e  Z d  Z d   Z e d    Z RS(   s  A _multivalued class that can support gpg signed objects

    This class's feature is that it stores the raw text before parsing so that
    gpg can verify the signature.  Use it just like you would use the
    _multivalued class.

    This class only stores raw text if it is given a raw string, or if it
    detects a gpg signature when given a file or sequence of lines (see
    Deb822.split_gpg_and_payload for details).
    c         @ s  y | d } Wn# t  k
 r3 | j d d   } n X| d  k	 rt | d d   pg | j d d  pg d   t | t  r |  _ qt | t j  r | j	     _ qt
 | d  r qy/  j    f d   | D  \ } } } Wn t k
 rg  } } } n X| r| rt   } | j d j |   | j d  | j d j |   | j d  | j d j |   | j    _ n  y t |  } | | d <Wqt  k
 r| | d <qXn  t j  | |  d  S(	   Ni    Ri   R>   s   utf-8R:   c         3@ s!   |  ] }  j  |    Vq d  S(   N(   t   _bytes(   t   .0R*   (   R>   R   (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pys	   <genexpr>  s    s   
s   

(   t
   IndexErrorR  R%   t   getattrR   RI   R   Rn   Ro   R   R   R   Rg   R   R   RX   R   R?   R*  R   (   R   R   Rt   Ri   R   R   R   R   (    (   R>   R   s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s@    )	c         C@ sB   t  |  t  r |  St  |  t j  r2 |  j |  St d   d S(   st   Converts s to bytes if necessary, using encoding.

        If s is already bytes type, returns it directly.
        s    bytes or unicode/string requiredN(   R   RI   Rn   Ro   R   t	   TypeError(   R*   R>   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR:    s
    (   R   R   R   R   R   R:  (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR9    s   
	/t   Dscc           B@ sN   e  Z i d  d d g d 6d d d g d 6d d d g d 6d d d g d	 6Z RS(
   t   md5sumt   sizeR  t   filest   sha1s   checksums-sha1t   sha256s   checksums-sha256t   sha512s   checksums-sha512(   R   R   R+  (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR?    s
   t   Changesc           B@ s]   e  Z i d  d d d d g d 6d d d g d 6d d d g d	 6d
 d d g d 6Z d   Z RS(   R@  RA  R   t   priorityR  RB  RC  s   checksums-sha1RD  s   checksums-sha256RE  s   checksums-sha512c         C@ s   |  d d d } y | j  d  \ } } Wn t k
 rD d } n X|  d j d  ri |  d d  } n |  d d } d	 | | |  d f S(
   s>   Return the path in the pool where the files would be installedRB  i    R   t   /t   maint   sourcet   libi   s   pool/%s/%s/%s(   R   R@   R   (   R   R*   R   t
   subsectiont   subdir(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   get_pool_path  s    
(   R   R   R+  RN  (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRF    s   t
   PdiffIndexc           B@ sS   e  Z i d  d g d 6d  d d g d 6d  d d g d 6Z e d    Z d   Z RS(   t   SHA1RA  s   sha1-currentt   dates   sha1-historys   sha1-patchesc         C@ sW   i  } xJ |  j  D]? } t |  | d  r/ q n  |  j |  } i | d 6| | <q W| S(   NR   RA  (   R+  R   t   _get_size_field_length(   R   t   fixed_field_lengthsR   R8  (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR2  +  s    c         C@ s7   g  |  | D] } t  t | d   ^ q } t |  S(   NRA  (   R!   RU   t   max(   R   R   R3   t   lengths(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRR  7  s    -(   R   R   R+  R)  R2  RR  (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRO  $  s   t   Releasec           B@ s   e  Z d  Z i d d d g d 6d d d g d 6d d d g d 6d d d g d 6Z d Z d   Z e d	   e  Z e d
    Z d   Z	 RS(   s   Represents a Release file

    Set the size_field_behavior attribute to "dak" to make the size field
    length only as long as the longest actual value.  The default,
    "apt-ftparchive" makes the field 16 characters long regardless.
    R@  RA  R  RC  RD  RE  s   apt-ftparchivec         C@ s(   | d k r t  d   n	 | |  _ d  S(   Ns   apt-ftparchivet   daks<   size_field_behavior must be either 'apt-ftparchive' or 'dak'(   s   apt-ftparchiveRW  (   R@   t   _Release__size_field_behavior(   R   RQ   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   set_size_field_behaviorN  s    c         C@ s   |  j  S(   N(   RX  (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR}   T  s    c         C@ s>   i  } x1 |  j  D]& } |  j |  } i | d 6| | <q W| S(   NRA  (   R+  RR  (   R   RS  R   R8  (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR2  W  s
    c         C@ s]   |  j  d k r d S|  j  d k rY g  |  | D] } t t | d   ^ q- } t |  Sd  S(   Ns   apt-ftparchivei   RW  RA  (   t   size_field_behaviorR!   RU   RT  (   R   R   R3   RU  (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRR  _  s
    -(
   R   R   R   R+  RX  RY  R)  RZ  R2  RR  (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRV  <  s   			t   Sourcesc           B@ sG   e  Z d  Z d d d d d g Z d   Z e d	 e e d d   Z	 RS(
   s$   Represent an APT source package lists   build-dependss   build-depends-indeps   build-conflictss   build-conflicts-indept   binaryc         O@ s*   t  j |  | |  t j |  | |  d  S(   N(   R?  R   R!  (   R   R   Rt   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   m  s    s   utf-8c         C@ s"   t  t |   j | | | | |  S(   s   Generator that yields a Deb822 object for each paragraph in Sources.

        Note that this overloaded form of the generator uses apt_pkg (a strict
        but fast parser) by default.

        See the Deb822.iter_paragraphs function for details.
        (   t   superR[  Rx   (   Rq   Ri   Rj   Rr   Rs   R>   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRx   q  s    
N(
   R   R   R   R$  R   R   R%   R   R	   Rx   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR[  g  s   	t   Packagesc        	   B@ sS   e  Z d  Z d d d d d d d d d	 g	 Z d
   Z e d e e d d   Z	 RS(   s$   Represent an APT binary package listt   dependss   pre-dependst
   recommendst   suggestst   breakst	   conflictst   providest   replacest   enhancesc         O@ s*   t  j |  | |  t j |  | |  d  S(   N(   Re   R   R!  (   R   R   Rt   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s    s   utf-8c         C@ s"   t  t |   j | | | | |  S(   s  Generator that yields a Deb822 object for each paragraph in Packages.

        Note that this overloaded form of the generator uses apt_pkg (a strict
        but fast parser) by default.

        See the Deb822.iter_paragraphs function for details.
        (   R]  R^  Rx   (   Rq   Ri   Rj   Rr   Rs   R>   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRx     s    
N(
   R   R   R   R$  R   R   R%   R   R	   Rx   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR^    s   			t   _ClassInitMetac           B@ s   e  Z d  Z d   Z RS(   s  Metaclass for classes that can be initialized at creation time.

    Implement the method

      @classmethod
      def _class_init(cls, new_attrs):
        pass

    on a class, and apply this metaclass to it.  The _class_init method will be
    called right after the class is created.  The 'new_attrs' param is a dict
    containing the attributes added in the definition of the class.
    c         C@ s-   t  t |   j | | |  |  j |  d  S(   N(   R]  Rg  R   t   _class_init(   Rq   R  t   basest   attrs(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s    (   R   R   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRg    s   t   RestrictedFields   name from_str to_str allow_nonec           B@ s    e  Z d  Z d d e d  Z RS(   s   Placeholder for a property providing access to a restricted field.

    Use this as an attribute when defining a subclass of RestrictedWrapper.
    It will be replaced with a property.  See the RestrictedWrapper
    documentation for an example.
    c      	   C@ s+   t  t |   j |  | d | d | d | S(   s  Create a new RestrictedField placeholder.

        The getter that will replace this returns (or applies the given to_str
        function to) None for fields that do not exist in the underlying data
        object.

        :param field_name: The name of the deb822 field.
        :param from_str: The function to apply for getters (default is to return
            the string directly).
        :param to_str: The function to apply for setters (default is to use the
            value directly).  If allow_none is True, this function may return
            None, in which case the underlying key is deleted.
        :param allow_none: Whether it is allowed to set the value to None
            (which results in the underlying key being deleted).
        t   from_strt   to_strt
   allow_none(   R]  Rk  t   __new__(   Rq   R  Rl  Rm  Rn  (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRo    s    N(   R   R   R   R%   R   Ro  (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRk    s   t   RestrictedWrapperc           B@ sk   e  Z d  Z e d    Z e d    Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z RS(
   sH  Base class to wrap a Deb822 object, restricting write access to some keys.

    The underlying data is hidden internally.  Subclasses may keep a reference
    to the data before giving it to this class's constructor, if necessary, but
    RestrictedProperty should cover most use-cases.  The dump method from
    Deb822 is directly proxied.

    Typical usage:

        class Foo(object):
            def __init__(self, ...):
                # ...

            @staticmethod
            def from_str(self, s):
                # Parse s...
                return Foo(...)

            def to_str(self):
                # Return in string format.
                return ...

        class MyClass(deb822.RestrictedWrapper):
            def __init__(self):
                data = deb822.Deb822()
                data['Bar'] = 'baz'
                super(MyClass, self).__init__(data)

            foo = deb822.RestrictedProperty(
                    'Foo', from_str=Foo.from_str, to_str=Foo.to_str)

            bar = deb822.RestrictedProperty('Bar', allow_none=False)

        d = MyClass()
        d['Bar'] # returns 'baz'
        d['Bar'] = 'quux' # raises RestrictedFieldError
        d.bar = 'quux'
        d.bar # returns 'quux'
        d['Bar'] # returns 'quux'

        d.foo = Foo(...)
        d['Foo'] # returns string representation of foo
    c         C@ sn   g  } xR | j    D]D \ } } t | t  r | j | j j    |  j | |  q q Wt |  |  _ d  S(   N(	   R:   R   Rk  R4   R  R   t)   _RestrictedWrapper__init_restricted_fieldt	   frozensett%   _RestrictedWrapper__restricted_fields(   Rq   t	   new_attrst   restricted_fieldst	   attr_namet   val(    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRh    s    c         @ sD     f d   }   f d   } t  |  | t | | d    j   d  S(   Nc         @ s5   |  j  j   j  }   j d  k	 r1   j |  S| S(   N(   t   _RestrictedWrapper__dataR  R  Rl  R%   (   R   Rw  (   R.  (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   getter  s    c         @ s   | d  k	 r-   j d  k	 r-   j |  } n  | d  k rv   j rg   j |  j k rs |  j   j =qs q t d   n | |  j   j <d  S(   Ns   value must not be None(   R%   Rm  Rn  R  Rx  R>  (   R   Rw  (   R.  (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   setter  s    	(   t   setattrR)  R%   R  (   Rq   Rv  R.  Ry  Rz  (    (   R.  s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   __init_restricted_field   s    c         C@ s    t  t |   j   | |  _ d S(   s5   Initializes the wrapper over 'data', a Deb822 object.N(   R]  Rp  R   Rx  (   R   R+   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR     s    c         C@ s   |  j  | S(   N(   Rx  (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR,     s    c         C@ s9   | j    |  j k r( t d |   n  | |  j | <d  S(   Ns<   %s may not be modified directly; use the associated property(   R   Rs  R   Rx  (   R   R   RQ   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRV     s
    c         C@ s6   | j    |  j k r( t d |   n  |  j | =d  S(   Ns<   %s may not be modified directly; use the associated property(   R   Rs  R   Rx  (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRW   %  s
    c         C@ s   t  |  j  S(   N(   R6   Rx  (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR    ,  s    c         C@ s   t  |  j  S(   N(   R!   Rx  (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR"   /  s    c         O@ s   |  j  j | |   S(   sc   Calls dump() on the underlying data object.

        See Deb822.dump for more information.
        (   Rx  R   (   R   R   Rt   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   2  s    (   R   R   R   R   Rh  Rq  R   R,   RV   RW   R    R"   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRp    s   ,							t   _CaseInsensitiveStringc           B@ s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   Case insensitive string.
    c         C@ s7   t  j |  |  } | j   | _ t | j  | _ | S(   N(   RU   Ro  R   t	   str_lowert   hasht   str_lower_hash(   Rq   t   str_R*   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRo  >  s    c         C@ s   |  j  S(   N(   R  (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyRd   D  s    c         C@ s   |  j  | j   k S(   N(   R~  R   (   R   R[   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR^   G  s    c         C@ s   |  j  S(   N(   R~  (   R   (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR   J  s    (   R   R   R   Ro  Rd   R^   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyR}  :  s
   			(;   t
   __future__R    R   t   debian.deprecationR   Rl   Rm   R   Rk   t   ImportErrorR   R	   RO   R  R   R   Ra   RL   R   R   R   Rn   Rb   R   Rr  R   R   t	   ExceptionR   R   t   MappingR   t   objectR-   t   MutableMappingR9   Re   R   R   R   R  R!  R*  R9  R?  RF  RO  RV  R[  R^  t   typeRg  R  Rk  t   add_metaclassRp  RU   R}  RA   (    (    (    s1   /usr/lib/python2.7/dist-packages/debian/deb822.pyt   <module>   s^   

		"/ ~kHH	 +	p