summaryrefslogtreecommitdiffstats
path: root/doc/examples/records.py
diff options
context:
space:
mode:
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