diff options
Diffstat (limited to 'doc/examples')
| -rw-r--r-- | doc/examples/acquire.py | 4 | ||||
| -rwxr-xr-x | doc/examples/build-deps.py | 2 | ||||
| -rwxr-xr-x | doc/examples/deb_inspect.py | 2 | ||||
| -rwxr-xr-x | doc/examples/gui-inst.py | 2 | ||||
| -rw-r--r-- | doc/examples/progress.py | 6 | ||||
| -rwxr-xr-x | doc/examples/recommends.py | 2 | ||||
| -rwxr-xr-x | doc/examples/versiontest.py | 6 |
7 files changed, 12 insertions, 12 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py index eef6c1f7..939c33a2 100644 --- a/doc/examples/acquire.py +++ b/doc/examples/acquire.py @@ -27,7 +27,7 @@ recs = apt_pkg.GetPkgRecords(cache) list = apt_pkg.GetPkgSourceList() list.ReadMainList() -# show the amount fetch needed for a dist-upgrade +# show the amount fetch needed for a dist-upgrade depcache.Upgrade(True) progress = apt.progress.TextFetchProgress() fetcher = apt_pkg.GetAcquire(progress) @@ -67,7 +67,7 @@ for item in fetcher.Items: if item.Complete == False: print "No error, still nothing downloaded (%s)" % item.ErrorText print - + res = fetcher.Run() print "fetcher.Run() returned: %s" % res diff --git a/doc/examples/build-deps.py b/doc/examples/build-deps.py index 65e35f3d..81a8b408 100755 --- a/doc/examples/build-deps.py +++ b/doc/examples/build-deps.py @@ -3,7 +3,7 @@ import apt_pkg import sys -import sets # only needed for python2.3, python2.4 supports this naively +import sets # only needed for python2.3, python2.4 supports this naively def get_source_pkg(pkg, records, depcache): """ get the source package name of a given package """ diff --git a/doc/examples/deb_inspect.py b/doc/examples/deb_inspect.py index 0befd2bb..b57526c6 100755 --- a/doc/examples/deb_inspect.py +++ b/doc/examples/deb_inspect.py @@ -8,7 +8,7 @@ import os.path def Callback(What,Name,Link,Mode,UID,GID,Size,MTime,Major,Minor): """ callback for debExtract """ - + print "%s '%s','%s',%u,%u,%u,%u,%u,%u,%u"\ % (What,Name,Link,Mode,UID,GID,Size, MTime, Major, Minor); diff --git a/doc/examples/gui-inst.py b/doc/examples/gui-inst.py index feefd6ed..9a3b007f 100755 --- a/doc/examples/gui-inst.py +++ b/doc/examples/gui-inst.py @@ -23,7 +23,7 @@ if __name__ == "__main__": win.add(progress) progress.show() win.show() - + cache = apt.cache.Cache(progress.open) if cache["2vcard"].isInstalled: cache["2vcard"].markDelete() diff --git a/doc/examples/progress.py b/doc/examples/progress.py index 2723c382..b90253cb 100644 --- a/doc/examples/progress.py +++ b/doc/examples/progress.py @@ -23,13 +23,13 @@ class TextProgress(apt.OpProgress): class TextFetchProgress(apt.FetchProgress): def __init__(self): pass - + def start(self): pass - + def stop(self): pass - + def updateStatus(self, uri, descr, shortDescr, status): print "UpdateStatus: '%s' '%s' '%s' '%i'" % (uri,descr,shortDescr, status) def pulse(self): diff --git a/doc/examples/recommends.py b/doc/examples/recommends.py index b1094aee..c1a7eb2e 100755 --- a/doc/examples/recommends.py +++ b/doc/examples/recommends.py @@ -19,7 +19,7 @@ for package in cache.Packages: if not current: continue depends = current.DependsList - for (key, attr) in (('Suggests', 'suggested'), + for (key, attr) in (('Suggests', 'suggested'), ('Recommends', 'recommended')): list = depends.get(key, []) for dependency in list: diff --git a/doc/examples/versiontest.py b/doc/examples/versiontest.py index 95f887f2..c4e5f44d 100755 --- a/doc/examples/versiontest.py +++ b/doc/examples/versiontest.py @@ -10,7 +10,7 @@ if len(TestFile) != 1: print "Must have exactly 1 file name"; sys.exit(0); -# Go over the file.. +# Go over the file.. List = open(TestFile[0],"r"); CurLine = 0; while(1): @@ -21,10 +21,10 @@ while(1): Line = string.strip(Line); if len(Line) == 0 or Line[0] == '#': continue; - + Split = re.split("[ \n]",Line); - # Check forward + # Check forward if apt_pkg.VersionCompare(Split[0],Split[1]) != int(Split[2]): print "Comparision failed on line %u. '%s' ? '%s' %i != %i"%(CurLine, Split[0],Split[1],apt_pkg.VersionCompare(Split[0],Split[1]), |
