diff options
| author | Ben Finney <ben@benfinney.id.au> | 2008-05-16 14:58:00 +1000 |
|---|---|---|
| committer | Ben Finney <ben@benfinney.id.au> | 2008-05-16 14:58:00 +1000 |
| commit | b147f1846cd26ab25ad925105f52421992395918 (patch) | |
| tree | f1cb14ef290ab7ef91668b1b2a6f1a1bf41d3329 /apt | |
| parent | 44faadf294230dc6384b309b06089520d562f199 (diff) | |
| download | python-apt-b147f1846cd26ab25ad925105f52421992395918.tar.gz | |
Remove trailing whitespace.
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/cache.py | 42 | ||||
| -rw-r--r-- | apt/cdrom.py | 2 | ||||
| -rw-r--r-- | apt/debfile.py | 6 | ||||
| -rw-r--r-- | apt/package.py | 30 | ||||
| -rw-r--r-- | apt/progress.py | 26 |
5 files changed, 53 insertions, 53 deletions
diff --git a/apt/cache.py b/apt/cache.py index a92bd5be..6773aeec 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -1,19 +1,19 @@ # cache.py - apt cache abstraction -# +# # Copyright (c) 2005 Canonical -# +# # Author: Michael Vogt <michael.vogt@ubuntu.com> -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -36,7 +36,7 @@ class LockFailedException(IOError): pass class Cache(object): - """ Dictionary-like package cache + """ Dictionary-like package cache This class has all the packages that are available in it's dictionary """ @@ -53,7 +53,7 @@ class Cache(object): if self._callbacks.has_key(name): for callback in self._callbacks[name]: callback() - + def open(self, progress): """ Open the package cache, after that it can be used like a dictionary @@ -80,12 +80,12 @@ class Cache(object): self._dict[pkg.Name] = Package(self._cache, self._depcache, self._records, self._list, self, pkg) - + i += 1 if progress != None: progress.done() self._runCallbacks("cache_post_open") - + def __getitem__(self, key): """ look like a dictionary (get key) """ return self._dict[key] @@ -106,7 +106,7 @@ class Cache(object): def getChanges(self): """ Get the marked changes """ - changes = [] + changes = [] for name in self._dict.keys(): p = self._dict[name] if p.markedUpgrade or p.markedInstall or p.markedDelete or \ @@ -127,7 +127,7 @@ class Cache(object): " return the packages not downloadable packages in reqreinst state " reqreinst = set() for pkg in self: - if (not pkg.candidateDownloadable and + if (not pkg.candidateDownloadable and (pkg._pkg.InstState == apt_pkg.InstStateReInstReq or pkg._pkg.InstState == apt_pkg.InstStateHoldReInstReq)): reqreinst.add(pkg.name) @@ -136,7 +136,7 @@ class Cache(object): def _runFetcher(self, fetcher): # do the actual fetching res = fetcher.Run() - + # now check the result (this is the code from apt-get.cc) failed = False transient = False @@ -189,13 +189,13 @@ class Cache(object): return self._cache.Update(fetchProgress, self._list) finally: os.close(lock) - + def installArchives(self, pm, installProgress): installProgress.startUpdate() res = installProgress.run(pm) installProgress.finishUpdate() return res - + def commit(self, fetchProgress=None, installProgress=None): """ Apply the marked changes to the cache """ # FIXME: @@ -276,7 +276,7 @@ class FilteredCache(object): self._filters = [] def __len__(self): return len(self._filtered) - + def __getitem__(self, key): return self.cache._dict[key] @@ -294,7 +294,7 @@ class FilteredCache(object): if f.apply(self.cache._dict[pkg]): self._filtered[pkg] = 1 break - + def setFilter(self, filter): " set the current active filter " self._filters = [] @@ -318,7 +318,7 @@ class FilteredCache(object): return self.__dict__[key] else: return getattr(self.cache, key) - + def cache_pre_changed(): print "cache pre changed" @@ -370,7 +370,7 @@ if __name__ == "__main__": for pkg in f.keys(): #print c[pkg].name x = f[pkg].name - + print len(f) print "Testing filtered cache (no argument)" @@ -383,5 +383,5 @@ if __name__ == "__main__": for pkg in f.keys(): #print c[pkg].name x = f[pkg].name - + print len(f) diff --git a/apt/cdrom.py b/apt/cdrom.py index 9d4b62cb..c0e57094 100644 --- a/apt/cdrom.py +++ b/apt/cdrom.py @@ -44,4 +44,4 @@ class Cdrom(object): if not line.startswith("#") and cdid in line: return True return False - + diff --git a/apt/debfile.py b/apt/debfile.py index ddde5bf1..73e0288d 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -27,7 +27,7 @@ class DebPackage(object): def __getitem__(self, key): return self._sections[key] - + def filelist(self): """ return the list of files in the deb """ files = [] @@ -49,10 +49,10 @@ class DebPackage(object): if __name__ == "__main__": import sys - + d = DebPackage(sys.argv[1]) print d["Section"] print d["Maintainer"] print "Files:" print "\n".join(d.filelist) - + diff --git a/apt/package.py b/apt/package.py index ac045969..043f58ca 100644 --- a/apt/package.py +++ b/apt/package.py @@ -1,19 +1,19 @@ # package.py - apt package abstraction -# +# # Copyright (c) 2005 Canonical -# +# # Author: Michael Vogt <michael.vogt@ubuntu.com> -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -83,7 +83,7 @@ class Package(object): if ver == None: #print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) return False - + if ver.FileList == None: print "No FileList for: %s " % self._pkg.Name() return False @@ -138,7 +138,7 @@ class Package(object): base_deps.append(BaseDependency(depOr.TargetPkg.Name, depOr.CompType, depOr.TargetVer, (t == "PreDepends"))) depends_list.append(Dependency(base_deps)) return depends_list - + def candidateDependencies(self): """ return a list of candidate dependencies """ candver = self._depcache.GetCandidateVer(self._pkg) @@ -146,7 +146,7 @@ class Package(object): return [] return self._getDependencies(candver) candidateDependencies = property(candidateDependencies) - + def installedDependencies(self): """ return a list of installed dependencies """ ver = self._pkg.CurrentVer @@ -263,7 +263,7 @@ class Package(object): return "" return self._records.LongDesc rawDescription = property(rawDescription) - + def candidateRecord(self): " return the full pkgrecord as string of the candidate version " if not self._lookupRecord(True): @@ -292,7 +292,7 @@ class Package(object): def markedDelete(self): """ Package is marked for delete """ return self._depcache.MarkedDelete(self._pkg) - markedDelete = property(markedDelete) + markedDelete = property(markedDelete) def markedKeep(self): """ Package is marked for keep """ @@ -315,7 +315,7 @@ class Package(object): isInstalled = property(isInstalled) def isUpgradable(self): - """ Package is upgradable """ + """ Package is upgradable """ return self.isInstalled and self._depcache.IsUpgradable(self._pkg) isUpgradable = property(isUpgradable) @@ -364,7 +364,7 @@ class Package(object): "site '%s' isTrusted: '%s'"% (self.component, self.archive, self.origin, self.label, self.site, self.trusted) - + def candidateOrigin(self): ver = self._depcache.GetCandidateVer(self._pkg) if not ver: @@ -424,7 +424,7 @@ class Package(object): object as argument """ self._depcache.Commit(fprogress, iprogress) - + # self-test if __name__ == "__main__": diff --git a/apt/progress.py b/apt/progress.py index bb1bce35..19237a01 100644 --- a/apt/progress.py +++ b/apt/progress.py @@ -1,19 +1,19 @@ # Progress.py - progress reporting classes -# +# # Copyright (c) 2005 Canonical -# +# # Author: Michael Vogt <michael.vogt@ubuntu.com> -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -69,18 +69,18 @@ class FetchProgress(object): dlFailed : "Failed", dlHit : "Hit", dlIgnored : "Ignored"} - + def __init__(self): self.eta = 0.0 self.percent = 0.0 pass - + def start(self): pass - + def stop(self): pass - + def updateStatus(self, uri, descr, shortDescr, status): pass @@ -115,7 +115,7 @@ class TextFetchProgress(FetchProgress): sys.stdout.flush() return True def stop(self): - print "\rDone downloading " + print "\rDone downloading " def mediaChange(self, medium, drive): """ react to media change events """ res = True; @@ -144,7 +144,7 @@ class DumbInstallProgress(object): class InstallProgress(DumbInstallProgress): """ A InstallProgress that is pretty useful. It supports the attributes 'percent' 'status' and callbacks - for the dpkg errors and conffiles and status changes + for the dpkg errors and conffiles and status changes """ def __init__(self): DumbInstallProgress.__init__(self) |
