Ńň
óNc           @   s[   d  Z  d d k Z d d k Z d d k l Z d d k l Z d e i f d     YZ d S(   s"   Classes related to cdrom handling.i˙˙˙˙N(   t   AttributeDeprecatedBy(   t   CdromProgresst   Cdromc           B   sa   e  Z d  Z d d e d  Z d d  Z d d  Z e d    Z	 e
 i o e d  Z n RS(   s;  Support for apt-cdrom like features.

    This class has several optional parameters for initialisation, which may
    be used to influence the behaviour of the object:

    The optional parameter `progress` is a CdromProgress() subclass, which will
    ask for the correct cdrom, etc. If not specified or None, a CdromProgress()
    object will be used.

    The optional parameter `mountpoint` may be used to specify an alternative
    mountpoint.

    If the optional parameter `nomount` is True, the cdroms will not be
    mounted. This is the default behaviour.
    c         C   s   t  i i |   | d  j o t   |  _ n
 | |  _ | d  j	 o t  i i d |  n | o t  i i d d  n t  i i d d  d  S(   Ns   Acquire::cdrom::mounts   APT::CDROM::NoMountt   truet   false(   t   apt_pkgR   t   __init__t   NoneR   t	   _progresst   configt   set(   t   selft   progresst
   mountpointt   nomount(    (    s-   /usr/lib/python2.6/dist-packages/apt/cdrom.pyR   /   s    	c         C   s   t  i i |  | p |  i  S(   s   Add cdrom to the sources.list.(   R   R   t   addR   (   R   R   (    (    s-   /usr/lib/python2.6/dist-packages/apt/cdrom.pyR   >   s    c         C   s   t  i i |  | p |  i  S(   s   Identify the cdrom.(   R   R   t   identR   (   R   R   (    (    s-   /usr/lib/python2.6/dist-packages/apt/cdrom.pyR   B   s    c         C   sŤ   |  i    } | d j o t St i t i i d  d  } | i t i i d   xN | D]F } x= t	 |  D]/ } | i
   i d  o | | j o t Sqp Wq] Wt S(   s:   Check if the cdrom is already in the current sources.list.s   Dir::Etc::sourcepartst   *s   Dir::Etc::sourcelistt   #N(   R   R   t   Falset   globR   R	   t   find_dirt   appendt	   find_filet   opent   lstript
   startswitht   True(   R   t   cd_idt   srct   fnamet   line(    (    s-   /usr/lib/python2.6/dist-packages/apt/cdrom.pyt   in_sources_listF   s      $R    N(   t   __name__t
   __module__t   __doc__R   R   R   R   R   t   propertyR    R   t   _COMPAT_0_7R    t   inSourcesList(    (    (    s-   /usr/lib/python2.6/dist-packages/apt/cdrom.pyR      s   
(   R#   R   R   t   apt.deprecationR    t   apt.progress.baseR   R   (    (    (    s-   /usr/lib/python2.6/dist-packages/apt/cdrom.pyt   <module>   s
   