diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:07:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 18:07:41 +0000 |
commit | 76926159194e180003aa78de97e5f287bf4325a5 (patch) | |
tree | 2cea7245cdc3f66355900c820c145eba90598766 /doc/examples/records.py | |
parent | Initial commit. (diff) | |
download | python-apt-76926159194e180003aa78de97e5f287bf4325a5.tar.xz python-apt-76926159194e180003aa78de97e5f287bf4325a5.zip |
Adding upstream version 2.7.6.upstream/2.7.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/examples/records.py')
-rwxr-xr-x | doc/examples/records.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/examples/records.py b/doc/examples/records.py new file mode 100755 index 0000000..b88ed75 --- /dev/null +++ b/doc/examples/records.py @@ -0,0 +1,16 @@ +#!/usr/bin/python3 + +import apt + +cache = apt.Cache() + +for pkg in cache: + if not pkg.candidate.record: + continue + if "Task" in pkg.candidate.record: + print( + "Pkg {} is part of '{}'".format( + pkg.name, pkg.candidate.record["Task"].split() + ) + ) + # print pkg.candidateRecord |