\e NdZddlZddlZddlmZGddej Zy)z"Classes related to cdrom handling.N) CdromProgressc eZdZdZ d dedzdedzdeddfdZd dedzdefdZd dedzdefd Z e defd Z y) Cdroma;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. Nprogress mountpointnomountreturnc>tjj||t|_n||_| tj j d||r!tj j ddytj j ddy)NzAcquire::cdrom::mountzAPT::CDROM::NoMounttruefalse)apt_pkgr__init__r _progressconfigset)selfrrrs +/usr/lib/python3/dist-packages/apt/cdrom.pyrzCdrom.__init__/st  t$  *_DN%DN  ! NN  6 C  NN  4f = NN  4g >c^tjj||xs |jS)zAdd cdrom to the sources.list.)r raddrrrs rrz Cdrom.addCs"}}  x'A4>>BBrc^tjj||xs |jS)zIdentify the cdrom.)r ridentrrs rrz Cdrom.identGs"}}""4)CT^^DDrc|j}|ytjtjj ddz}|j tjj d|D]M}t|5}|D]1}|jjdr#||vs(dddy dddOy#1swYZxYw)z:Check if the cdrom is already in the current sources.list.NFzDir::Etc::sourceparts*zDir::Etc::sourcelist#T) rglobr rfind_dirappend find_fileopenlstrip startswith)rcd_idsrcfnamefobjlines rin_sources_listzCdrom.in_sources_listKs  =ii//0GH3NO 7>>++,BCD $Ee $ $D;;=33C8Ud]# $ $$ $ $ $   $ $s%C -C 2C =C  C )NNT)N) __name__ __module__ __qualname____doc__rstrboolrrrpropertyr)rrrrs$*.!% ?$&?$J? ?  ?(CMD0CDCEmd2EcErr)r-rr apt.progress.baserrr1rrr3s#,) +=GMM=r