apt.cdrom - Functionality like in apt-cdrom

Classes related to cdrom handling.

class apt.cdrom.Cdrom(progress: CdromProgress | None = None, mountpoint: str | None = None, nomount: bool = True)

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.

add(progress: CdromProgress | None = None) bool

Add cdrom to the sources.list.

ident(progress: CdromProgress | None = None) str

Identify the cdrom.

property in_sources_list: bool

Check if the cdrom is already in the current sources.list.