diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-03-09 14:57:55 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-03-09 14:57:55 +0000 |
| commit | 6d42024c88d207c35718f4f8458e58fc44951830 (patch) | |
| tree | dbb993ce5d2b03738fa3f92094d881f2646743c5 /doc | |
| parent | e2d599df4c4375fb90289d4d038c2575361a3b20 (diff) | |
| download | python-apt-6d42024c88d207c35718f4f8458e58fc44951830.tar.gz | |
* experimental progress callback is back, not too usefull now
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/examples/depcache.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/examples/depcache.py b/doc/examples/depcache.py index a5ecc240..76487b1d 100644 --- a/doc/examples/depcache.py +++ b/doc/examples/depcache.py @@ -2,15 +2,23 @@ # example how to deal with the depcache import apt_pkg +import sys + +def progress(percent, data): + print "%s %s" % (data, percent) + # init apt_pkg.init() -cache = apt_pkg.GetCache() +cache = apt_pkg.GetCache(progress,None) print "Available packages: %s " % cache.PackageCount +sys.exit() + iter = cache["base-config"] print "example package iter: %s" % iter + # get depcache depcache = apt_pkg.GetDepCache(cache) depcache.ReadPinFile() |
