summaryrefslogtreecommitdiffstats
path: root/doc/examples/print_uris.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/print_uris.py')
-rwxr-xr-xdoc/examples/print_uris.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/examples/print_uris.py b/doc/examples/print_uris.py
new file mode 100755
index 0000000..1b59e00
--- /dev/null
+++ b/doc/examples/print_uris.py
@@ -0,0 +1,10 @@
+#!/usr/bin/python3
+#
+# a example that prints the URIs of all upgradable packages
+#
+
+import apt
+
+for pkg in apt.Cache():
+ if pkg.is_upgradable:
+ print(pkg.candidate.uri)