summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/acquire.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py
new file mode 100644
index 00000000..12727232
--- /dev/null
+++ b/doc/examples/acquire.py
@@ -0,0 +1,24 @@
+import apt_pkg
+
+apt_pkg.init()
+
+cache = apt_pkg.GetCache()
+depcache = apt_pkg.GetDepCache(cache)
+
+recs = apt_pkg.GetPkgRecords(cache)
+list = apt_pkg.GetPkgSourceList()
+list.ReadMainList()
+
+pkg = cache["3ddesktop"]
+depcache.MarkInstall(pkg)
+
+fetcher = apt_pkg.GetAcquire()
+pm = apt_pkg.GetPackageManager(depcache)
+
+print pm
+print fetcher
+
+pm.GetArchives(fetcher,list,recs)
+
+fetcher.Run()
+