diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-01-11 19:30:07 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-01-11 19:30:07 +0100 |
| commit | b237760c6d7009f9833b86e6dbfc3cbf6d059977 (patch) | |
| tree | 19dd8f4f11b1c004a7f9bbb2b9e9f545d0ed2492 /doc/examples/acquire.py | |
| parent | 31cdfa2e20361f76f6e011bbcdad19f9daa1f58f (diff) | |
| parent | 7b14352c54b7acbf2a68240fa960e188c6e8742a (diff) | |
| download | python-apt-b237760c6d7009f9833b86e6dbfc3cbf6d059977.tar.gz | |
Merge Ben Finney's whitespace changes (Closes: #481563)
Diffstat (limited to 'doc/examples/acquire.py')
| -rw-r--r-- | doc/examples/acquire.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py index 939c33a2..58372961 100644 --- a/doc/examples/acquire.py +++ b/doc/examples/acquire.py @@ -4,15 +4,15 @@ import os import sys import tempfile + def get_file(fetcher, uri, destFile): - # get the file - af = apt_pkg.GetPkgAcqFile(fetcher, - uri=uri, - descr="sample descr", destFile=destFile) - res = fetcher.Run() - if res != fetcher.ResultContinue: - return False - return True + # get the file + af = apt_pkg.GetPkgAcqFile(fetcher, uri=uri, descr="sample descr", + destFile=destFile) + res = fetcher.Run() + if res != fetcher.ResultContinue: + return False + return True apt_pkg.init() @@ -32,7 +32,7 @@ depcache.Upgrade(True) progress = apt.progress.TextFetchProgress() fetcher = apt_pkg.GetAcquire(progress) pm = apt_pkg.GetPackageManager(depcache) -pm.GetArchives(fetcher,list,recs) +pm.GetArchives(fetcher, list, recs) print "%s (%s)" % (apt_pkg.SizeToStr(fetcher.FetchNeeded), fetcher.FetchNeeded) actiongroup = apt_pkg.GetPkgActionGroup(depcache) for pkg in cache.Packages: @@ -43,7 +43,7 @@ try: os.mkdir("/tmp/pyapt-test/partial") except OSError: pass -apt_pkg.Config.Set("Dir::Cache::archives","/tmp/pyapt-test") +apt_pkg.Config.Set("Dir::Cache::archives", "/tmp/pyapt-test") pkg = cache["3ddesktop"] depcache.MarkInstall(pkg) @@ -58,7 +58,7 @@ print fetcher get_file(fetcher, "ftp://ftp.debian.org/debian/dists/README", "/tmp/lala") -pm.GetArchives(fetcher,list,recs) +pm.GetArchives(fetcher, list, recs) for item in fetcher.Items: print item @@ -75,6 +75,3 @@ print "fetcher.Run() returned: %s" % res print "now runing pm.DoInstall()" res = pm.DoInstall(1) print "pm.DoInstall() returned: %s"% res - - - |
