summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/acquire.py3
-rw-r--r--doc/examples/metaindex.py15
2 files changed, 16 insertions, 2 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py
index a0790c98..1291dbfa 100644
--- a/doc/examples/acquire.py
+++ b/doc/examples/acquire.py
@@ -45,7 +45,7 @@ fetcher = apt_pkg.GetAcquire(progress)
pm = apt_pkg.GetPackageManager(depcache)
pm.GetArchives(fetcher,list,recs)
print "%s (%s)" % (apt_pkg.SizeToStr(fetcher.FetchNeeded), fetcher.FetchNeeded)
-
+actiongroup = apt_pkg.GetPkgActionGroup(depcache)
for pkg in cache.Packages:
depcache.MarkKeep(pkg)
@@ -68,7 +68,6 @@ print pm
print fetcher
get_file(fetcher, "ftp://ftp.debian.org/debian/dists/README", "/tmp/lala")
-sys.exit(1)
pm.GetArchives(fetcher,list,recs)
diff --git a/doc/examples/metaindex.py b/doc/examples/metaindex.py
new file mode 100644
index 00000000..1bce0dba
--- /dev/null
+++ b/doc/examples/metaindex.py
@@ -0,0 +1,15 @@
+
+import apt_pkg
+
+apt_pkg.init()
+
+sources = apt_pkg.GetPkgSourceList()
+sources.ReadMainList()
+
+
+for metaindex in sources.List:
+ print metaindex
+ print "URI: ",metaindex.URI
+ print "Dist: ",metaindex.Dist
+ print "IndexFiles: ","\n".join([str(i) for i in metaindex.IndexFiles])
+ print