diff options
| author | Julian Andres Klode <jak@debian.org> | 2014-01-06 13:24:51 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2014-01-06 13:24:51 +0100 |
| commit | 8b8a55f10ca47fe297fbb9b16a8e100658c60df3 (patch) | |
| tree | d2e941190673478d7d92821715ac8df476e17843 /apt/cache.py | |
| parent | f6c94dbe9cbfa645b19832842183e248f940f829 (diff) | |
| download | python-apt-8b8a55f10ca47fe297fbb9b16a8e100658c60df3.tar.gz | |
Use print_function everywhere
This brings the code closer to Python 3. Automatically converted
using 2to3 -f print.
Diffstat (limited to 'apt/cache.py')
| -rw-r--r-- | apt/cache.py | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/apt/cache.py b/apt/cache.py index 6b1e2bda..593e70a7 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -19,6 +19,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA +from __future__ import print_function + import fnmatch import os import weakref @@ -721,31 +723,31 @@ class FilteredCache(object): def cache_pre_changed(): - print "cache pre changed" + print("cache pre changed") def cache_post_changed(): - print "cache post changed" + print("cache post changed") def _test(): """Internal test code.""" - print "Cache self test" + print("Cache self test") apt_pkg.init() cache = Cache(apt.progress.text.OpProgress()) cache.connect("cache_pre_change", cache_pre_changed) cache.connect("cache_post_change", cache_post_changed) - print ("aptitude" in cache) + print(("aptitude" in cache)) pkg = cache["aptitude"] - print pkg.name - print len(cache) + print(pkg.name) + print(len(cache)) for pkgname in cache.keys(): assert cache[pkgname].name == pkgname cache.upgrade() changes = cache.get_changes() - print len(changes) + print(len(changes)) for pkg in changes: assert pkg.name @@ -759,28 +761,28 @@ def _test(): cache._fetch_archives(fetcher, pm) #sys.exit(1) - print "Testing filtered cache (argument is old cache)" + print("Testing filtered cache (argument is old cache)") filtered = FilteredCache(cache) filtered.cache.connect("cache_pre_change", cache_pre_changed) filtered.cache.connect("cache_post_change", cache_post_changed) filtered.cache.upgrade() filtered.set_filter(MarkedChangesFilter()) - print len(filtered) + print(len(filtered)) for pkgname in filtered.keys(): assert pkgname == filtered[pkg].name - print len(filtered) + print(len(filtered)) - print "Testing filtered cache (no argument)" + print("Testing filtered cache (no argument)") filtered = FilteredCache(progress=apt.progress.base.OpProgress()) filtered.cache.connect("cache_pre_change", cache_pre_changed) filtered.cache.connect("cache_post_change", cache_post_changed) filtered.cache.upgrade() filtered.set_filter(MarkedChangesFilter()) - print len(filtered) + print(len(filtered)) for pkgname in filtered.keys(): assert pkgname == filtered[pkgname].name - print len(filtered) + print(len(filtered)) if __name__ == '__main__': _test() |
