ó
AqzRc           @   sd   d  Z  d d l Z d d l Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d S(	   s   A Debian Control fileiÿÿÿÿNt   NoControlErrorc           B   s   e  Z d  Z RS(   s   No control found(   t   __name__t
   __module__t   __doc__(    (    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyR       s   t   ParseControlErrorc           B   s   e  Z d  Z RS(   s   Problem parsing control(   R   R   R   (    (    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyR      s   t   Controlc           B   s\   e  Z d  Z d d d „ Z d „  Z d „  Z e d „  ƒ Z e d „  ƒ Z	 e d „  ƒ Z
 RS(	   s   A Debian controls   debian/controlc         C   s•   | r t  j | ƒ } nL t j | t j ƒ s@ t d | ƒ ‚ n  t | ƒ  } t  j | ƒ } Wd QX| j ƒ  s t	 d ƒ ‚ n  | |  _
 | |  _ d S(   s&  
        Parse an existing control file.

        @param contents: content of a control file
        @type contents: C{str}
        @param filename: name of the control file
        @type filename: C{str}
        @return: Control object
        @rtype: C{gbp.deb.conrol.Control} object
        s   Control file %s does not existNs)   Empty or invalid control file or contents(   t   emailt   message_from_stringt   ost   accesst   F_OKR    t   opent   message_from_filet   itemsR   t   _controlt   filename(   t   selft   contentsR   t   controlt   f(    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyt   __init__!   s    	c         C   s   |  j  | S(   N(   R   (   R   t   item(    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyt   __getitem__;   s    c         C   s   | |  j  | <d  S(   N(   R   (   R   R   t   value(    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyt   __setitem__>   s    c         C   s   |  j  d S(   s   The packges namet   Source(   R   (   R   (    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyt   nameA   s    c         C   s   |  j  d S(   s   The packges sectiont   Section(   R   (   R   (    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyt   sectionF   s    c         C   s   |  j  d S(   s   The packges priorityt   Priority(   R   (   R   (    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyt   priorityK   s    N(   R   R   R   t   NoneR   R   R   t   propertyR   R   R   (    (    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyR      s   		(   R   R   R   t	   ExceptionR    R   t   objectR   (    (    (    s3   /usr/lib/python2.7/dist-packages/gbp/deb/control.pyt   <module>   s
   