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/progress | |
| 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/progress')
| -rw-r--r-- | apt/progress/__init__.py | 2 | ||||
| -rw-r--r-- | apt/progress/base.py | 4 | ||||
| -rw-r--r-- | apt/progress/gtk2.py | 4 | ||||
| -rw-r--r-- | apt/progress/text.py | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 776a7034..c689de5c 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -23,5 +23,7 @@ This package provides progress reporting for the python-apt package. The module GTK+ applications, and the module 'text' provides classes for terminals, etc. """ +from __future__ import print_function + __all__ = [] diff --git a/apt/progress/base.py b/apt/progress/base.py index 2c80ae29..66d56173 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -22,6 +22,8 @@ Custom progress classes should inherit from these classes. They can also be used as dummy progress classes which simply do nothing. """ +from __future__ import print_function + import errno import fcntl import os @@ -217,7 +219,7 @@ class InstallProgress(object): except IOError as err: # resource temporarly unavailable is ignored if err.errno != errno.EAGAIN and err.errno != errno.EWOULDBLOCK: - print err.strerror + print(err.strerror) return pkgname = status = status_str = percent = base = "" diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py index b978c34f..7d142399 100644 --- a/apt/progress/gtk2.py +++ b/apt/progress/gtk2.py @@ -22,6 +22,8 @@ # USA """GObject-powered progress classes and a GTK+ status widget.""" +from __future__ import print_function + import pygtk pygtk.require('2.0') import gtk @@ -422,7 +424,7 @@ def _test(): try: cache.commit(apt_progress.acquire, apt_progress.install) except Exception as exc: - print >> sys.stderr, "Exception happened:", exc + print("Exception happened:", exc, file=sys.stderr) if len(sys.argv) > 1: deb = DebPackage(sys.argv[1], cache) deb.install(apt_progress.dpkg_install) diff --git a/apt/progress/text.py b/apt/progress/text.py index 76a4309e..880a112c 100644 --- a/apt/progress/text.py +++ b/apt/progress/text.py @@ -15,6 +15,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA """Progress reporting for text interfaces.""" +from __future__ import print_function + import os import sys |
