diff options
| author | Ben Finney <ben@benfinney.id.au> | 2008-05-16 20:12:36 +1000 |
|---|---|---|
| committer | Ben Finney <ben@benfinney.id.au> | 2008-05-16 20:12:36 +1000 |
| commit | f264f62b7602f960bc35f3f68b1ed14c61bbfdd5 (patch) | |
| tree | 1ee94164129169dda7273fb6553bef2a670d3d62 /doc | |
| parent | 97c3c24b3060e8280fffed68ed60a68e04f382ca (diff) | |
| download | python-apt-f264f62b7602f960bc35f3f68b1ed14c61bbfdd5.tar.gz | |
Limit code lines to maximum 79 characters, to conform with PEP 8.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/examples/action.py | 3 | ||||
| -rw-r--r-- | doc/examples/all_deps.py | 6 | ||||
| -rwxr-xr-x | doc/examples/config.py | 3 | ||||
| -rwxr-xr-x | doc/examples/configisc.py | 9 | ||||
| -rw-r--r-- | doc/examples/depcache.py | 3 | ||||
| -rw-r--r-- | doc/examples/progress.py | 7 | ||||
| -rwxr-xr-x | doc/examples/records.py | 3 | ||||
| -rw-r--r-- | doc/examples/sources.py | 3 |
8 files changed, 25 insertions, 12 deletions
diff --git a/doc/examples/action.py b/doc/examples/action.py index 9277129e..7153292c 100644 --- a/doc/examples/action.py +++ b/doc/examples/action.py @@ -86,7 +86,8 @@ print "UsrSize: %s " % apt_pkg.SizeToStr(depcache.UsrSize) print "DebSize: %s " % apt_pkg.SizeToStr(depcache.DebSize) for pkg in cache.Packages: - if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) and depcache.IsUpgradable(pkg): + if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) \ + and depcache.IsUpgradable(pkg): print "Upgrade didn't upgrade (kept): %s" % pkg.Name print "\nPerforming DistUpgrade" diff --git a/doc/examples/all_deps.py b/doc/examples/all_deps.py index 37222463..2feeb125 100644 --- a/doc/examples/all_deps.py +++ b/doc/examples/all_deps.py @@ -14,9 +14,11 @@ def dependencies(cache, pkg, deps, key="Depends"): for depVerList in dependslist[key]:
for dep in depVerList:
if cache.has_key(dep.TargetPkg.Name):
- if pkg.name != dep.TargetPkg.Name and not dep.TargetPkg.Name in deps:
+ if pkg.name != dep.TargetPkg.Name and \
+ not dep.TargetPkg.Name in deps:
deps.add(dep.TargetPkg.Name)
- dependencies(cache, cache[dep.TargetPkg.Name], deps, key)
+ dependencies(
+ cache, cache[dep.TargetPkg.Name], deps, key)
return deps
diff --git a/doc/examples/config.py b/doc/examples/config.py index d0895690..cc1aae44 100755 --- a/doc/examples/config.py +++ b/doc/examples/config.py @@ -6,7 +6,8 @@ # config.py -no-h --no-help --help=no ; Turn off help # config.py -qqq -q=3 ; verbosity to 3 # config.py -c /etc/apt/apt.conf ; include that config file] -# config.py -o help=true ; Turn on help by giving a config file string +# config.py -o help=true ; Turn on help by giving a +# ; config file string # config.py -no-h -- -help ; Turn off help, specify the file '-help' # -c and -o are standard APT-program options. diff --git a/doc/examples/configisc.py b/doc/examples/configisc.py index 03fa2cad..1d5965f5 100755 --- a/doc/examples/configisc.py +++ b/doc/examples/configisc.py @@ -32,10 +32,13 @@ if Cnf.has_key("Zone"): for I in Cnf.List("zone"): SubCnf = Cnf.SubTree(I) if SubCnf.Find("type") == "slave": - print "Masters for %s: %s" % (SubCnf.MyTag(), SubCnf.ValueList("masters")) + print "Masters for %s: %s" % ( + SubCnf.MyTag(), SubCnf.ValueList("masters")) else: print "Tree definitions:" for I in Cnf.List("tree"): SubCnf = Cnf.SubTree(I) - # This could use Find which would eliminate the possibility of exceptions. - print "Subtree %s with sections '%s' and architectures '%s'" % (SubCnf.MyTag(), SubCnf["Sections"], SubCnf["Architectures"]) + # This could use Find which would eliminate the possibility of + # exceptions. + print "Subtree %s with sections '%s' and architectures '%s'" % ( + SubCnf.MyTag(), SubCnf["Sections"], SubCnf["Architectures"]) diff --git a/doc/examples/depcache.py b/doc/examples/depcache.py index 556c954b..ad884fe7 100644 --- a/doc/examples/depcache.py +++ b/doc/examples/depcache.py @@ -84,7 +84,8 @@ print "UsrSize: %s " % apt_pkg.SizeToStr(depcache.UsrSize) print "DebSize: %s " % apt_pkg.SizeToStr(depcache.DebSize) for pkg in cache.Packages: - if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) and depcache.IsUpgradable(pkg): + if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) \ + and depcache.IsUpgradable(pkg): print "Upgrade didn't upgrade (kept): %s" % pkg.Name diff --git a/doc/examples/progress.py b/doc/examples/progress.py index 70fc92f3..c56734b7 100644 --- a/doc/examples/progress.py +++ b/doc/examples/progress.py @@ -34,10 +34,13 @@ class TextFetchProgress(apt.FetchProgress): pass def updateStatus(self, uri, descr, shortDescr, status): - print "UpdateStatus: '%s' '%s' '%s' '%i'" % (uri, descr, shortDescr, status) + print "UpdateStatus: '%s' '%s' '%s' '%i'" % ( + uri, descr, shortDescr, status) def pulse(self): - print "Pulse: CPS: %s/s; Bytes: %s/%s; Item: %s/%s" % (SizeToStr(self.currentCPS), SizeToStr(self.currentBytes), SizeToStr(self.totalBytes), self.currentItems, self.totalItems) + print "Pulse: CPS: %s/s; Bytes: %s/%s; Item: %s/%s" % ( + SizeToStr(self.currentCPS), SizeToStr(self.currentBytes), + SizeToStr(self.totalBytes), self.currentItems, self.totalItems) return True def mediaChange(self, medium, drive): diff --git a/doc/examples/records.py b/doc/examples/records.py index 9dfc460b..a7a87727 100755 --- a/doc/examples/records.py +++ b/doc/examples/records.py @@ -8,5 +8,6 @@ for pkg in cache: if not pkg.candidateRecord: continue if pkg.candidateRecord.has_key("Task"): - print "Pkg %s is part of '%s'" % (pkg.name, pkg.candidateRecord["Task"].split()) + print "Pkg %s is part of '%s'" % ( + pkg.name, pkg.candidateRecord["Task"].split()) #print pkg.candidateRecord diff --git a/doc/examples/sources.py b/doc/examples/sources.py index 8d807f4c..49652982 100644 --- a/doc/examples/sources.py +++ b/doc/examples/sources.py @@ -10,6 +10,7 @@ apt_pkg.init() sources = apt_pkg.GetPkgSrcRecords() sources.Restart() while sources.Lookup('hello'): - print sources.Package, sources.Version, sources.Maintainer, sources.Section, `sources.Binaries` + print sources.Package, sources.Version, sources.Maintainer, \ + sources.Section, `sources.Binaries` print sources.Files print sources.Index.ArchiveURI(sources.Files[0][2]) |
