summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-11-18 01:01:37 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-11-18 01:01:37 +0000
commitc187e828e1661d09a8437214b2f90dcc25c05c99 (patch)
treea08f97e80e66887baafa5bd41384ab78ff92b082 /doc/examples
parent4da233eef44c921152daf224a043ab8e2181ef9f (diff)
downloadpython-apt-c187e828e1661d09a8437214b2f90dcc25c05c99.tar.gz
* basic pkgAcquire + pkgPackageManager support added
Diffstat (limited to 'doc/examples')
-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()
+