summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-11-18 11:23:10 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-11-18 11:23:10 +0000
commita56d4330c45ea9dbb9dd8babb7e8f17ae79a6fdd (patch)
tree1fabe39aa01711733a75403a9257e7bd14dc53b3 /doc/examples
parentc187e828e1661d09a8437214b2f90dcc25c05c99 (diff)
downloadpython-apt-a56d4330c45ea9dbb9dd8babb7e8f17ae79a6fdd.tar.gz
* acquire interface works with progress reporting now
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/acquire.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py
index 12727232..98b70ab0 100644
--- a/doc/examples/acquire.py
+++ b/doc/examples/acquire.py
@@ -1,4 +1,6 @@
+import apt
import apt_pkg
+import os
apt_pkg.init()
@@ -9,10 +11,16 @@ recs = apt_pkg.GetPkgRecords(cache)
list = apt_pkg.GetPkgSourceList()
list.ReadMainList()
+os.mkdir("/tmp/pyapt-test")
+os.mkdir("/tmp/pyapt-test/partial")
+apt_pkg.Config.Set("Dir::Cache::archives","/tmp/pyapt-test")
+
pkg = cache["3ddesktop"]
depcache.MarkInstall(pkg)
-fetcher = apt_pkg.GetAcquire()
+progress = apt.progress.TextFetchProgress()
+fetcher = apt_pkg.GetAcquire(progress)
+#fetcher = apt_pkg.GetAcquire()
pm = apt_pkg.GetPackageManager(depcache)
print pm