xkdu ddZddlmZddlmZddlZddlZddlmZGddej Z dS)z"Classes related to cdrom handling.)print_function)OptionalN) CdromProgressc@eZdZdZddZd dZd dZedZdS) 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. NTcJtj||t|_n||_| tjd||r"tjdddStjdddS)NzAcquire::cdrom::mountzAPT::CDROM::NoMounttruefalse)apt_pkgr__init__r _progressconfigset)selfprogress mountpointnomounts +/usr/lib/python3/dist-packages/apt/cdrom.pyr zCdrom.__init__1s t$$$  *__DNN%DN  ! N  6 C C C  ? N  4f = = = = = N  4g > > > > >cPtj||p|jS)zAdd cdrom to the sources.list.)r raddr rrs rrz Cdrom.addAs#}  x'A4>BBBrcPtj||p|jS)zIdentify the cdrom.)r ridentr rs rrz Cdrom.identFs#}""4)CT^DDDrc|}|dStjtjddz}|tjd|D]i}t|5}|D]<}| ds||vrddddS= dddn #1swxYwYjdS)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_listKsC  =5i//0GHH3NOO 7>++,BCCDDD $ $Ee $ $$D;;==33C88$Ud]]# $ $ $ $ $ $ $ $ $$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $us1CCC# &C# )NNT)N) __name__ __module__ __qualname____doc__r rrpropertyr*rrrr s} ???? CCCC EEEE Xrr) r. __future__rtypingrrr apt.progress.baserrr0rrr4s,)(%%%%%% ++++++<<<<<GM<<<<<r