summaryrefslogtreecommitdiffstats
path: root/doc/examples/metaindex.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/metaindex.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/metaindex.py')
-rw-r--r--doc/examples/metaindex.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/examples/metaindex.py b/doc/examples/metaindex.py
new file mode 100644
index 0000000..2497e65
--- /dev/null
+++ b/doc/examples/metaindex.py
@@ -0,0 +1,16 @@
+#!/usr/bin/python3
+
+import apt_pkg
+
+apt_pkg.init()
+
+sources = apt_pkg.SourceList()
+sources.read_main_list()
+
+
+for metaindex in sources.list:
+ print(metaindex)
+ print("uri: ", metaindex.uri)
+ print("dist: ", metaindex.dist)
+ print("index_files: ", "\n".join([str(i) for i in metaindex.index_files]))
+ print()