summaryrefslogtreecommitdiff
path: root/apt/cache.py
diff options
context:
space:
mode:
authorBen Finney <ben@benfinney.id.au>2008-05-16 14:58:00 +1000
committerBen Finney <ben@benfinney.id.au>2008-05-16 14:58:00 +1000
commitb147f1846cd26ab25ad925105f52421992395918 (patch)
treef1cb14ef290ab7ef91668b1b2a6f1a1bf41d3329 /apt/cache.py
parent44faadf294230dc6384b309b06089520d562f199 (diff)
downloadpython-apt-b147f1846cd26ab25ad925105f52421992395918.tar.gz
Remove trailing whitespace.
Diffstat (limited to 'apt/cache.py')
-rw-r--r--apt/cache.py42
1 files changed, 21 insertions, 21 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)