diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-11-18 11:23:10 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-11-18 11:23:10 +0000 |
| commit | a56d4330c45ea9dbb9dd8babb7e8f17ae79a6fdd (patch) | |
| tree | 1fabe39aa01711733a75403a9257e7bd14dc53b3 /doc/examples | |
| parent | c187e828e1661d09a8437214b2f90dcc25c05c99 (diff) | |
| download | python-apt-a56d4330c45ea9dbb9dd8babb7e8f17ae79a6fdd.tar.gz | |
* acquire interface works with progress reporting now
Diffstat (limited to 'doc/examples')
| -rw-r--r-- | doc/examples/acquire.py | 10 |
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 |
