From 76926159194e180003aa78de97e5f287bf4325a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 20:07:41 +0200 Subject: Adding upstream version 2.7.6. Signed-off-by: Daniel Baumann --- doc/examples/cdrom.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 doc/examples/cdrom.py (limited to 'doc/examples/cdrom.py') diff --git a/doc/examples/cdrom.py b/doc/examples/cdrom.py new file mode 100644 index 0000000..ad4d2ba --- /dev/null +++ b/doc/examples/cdrom.py @@ -0,0 +1,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) -- cgit v1.2.3