summaryrefslogtreecommitdiffstats
path: root/doc/examples/cdrom.py
blob: ad4d2bab414165cc2e4d136feee1a484e647588f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python3
# example how to deal with the depcache

import sys

import apt_pkg
from progress import TextCdromProgress

# init
apt_pkg.init()

cdrom = apt_pkg.Cdrom()
print(cdrom)

progress = TextCdromProgress()

(res, ident) = cdrom.ident(progress)
print(f"ident result is: {res} ({ident}) ")

apt_pkg.config["APT::CDROM::Rename"] = "True"
cdrom.add(progress)

print("Exiting")
sys.exit(0)