summaryrefslogtreecommitdiffstats
path: root/doc/examples/records.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:07:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:07:41 +0000
commit76926159194e180003aa78de97e5f287bf4325a5 (patch)
tree2cea7245cdc3f66355900c820c145eba90598766 /doc/examples/records.py
parentInitial commit. (diff)
downloadpython-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-xdoc/examples/records.py16
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