diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-12-19 13:35:59 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-12-19 13:35:59 +0100 |
| commit | 375920c5172a5f60acba02b73c3b32ffbccc8ab2 (patch) | |
| tree | a1d1aff85af6453640168030c9b2c772f714689f /aptsources | |
| parent | 10ec8cd5b5614606b3db9fdc3d6e248984048f0e (diff) | |
| download | python-apt-375920c5172a5f60acba02b73c3b32ffbccc8ab2.tar.gz | |
pyflakes cleanup, use apt_pkg.gettext in aptsources too
Diffstat (limited to 'aptsources')
| -rw-r--r-- | aptsources/distinfo.py | 6 | ||||
| -rw-r--r-- | aptsources/distro.py | 4 | ||||
| -rw-r--r-- | aptsources/sourceslist.py | 3 |
3 files changed, 3 insertions, 10 deletions
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index c8ec5c46..ec162c2d 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -24,17 +24,13 @@ import errno import logging import os -import gettext from os import getenv from subprocess import Popen, PIPE import re import apt_pkg - -def _(s): - return gettext.dgettext("python-apt", s) - +from apt_pkg import gettext as _ class Template(object): diff --git a/aptsources/distro.py b/aptsources/distro.py index f777a4ea..b4056b27 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -30,9 +30,7 @@ import sys from xml.etree.ElementTree import ElementTree import gettext - -def _(s): - return gettext.dgettext("python-apt", s) +from apt_pkg import gettext as _ class NoDistroTemplateException(Exception): diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py index 40a0379b..e3b8c9be 100644 --- a/aptsources/sourceslist.py +++ b/aptsources/sourceslist.py @@ -23,7 +23,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA -import gettext import glob import logging import os.path @@ -35,6 +34,7 @@ import time import apt_pkg from distinfo import DistInfo from apt.deprecation import function_deprecated_by +from apt_pkg import gettext as _ # some global helpers @@ -446,7 +446,6 @@ class SourceEntryMatcher(object): def match(self, source): """Add a matching template to the source""" - _ = gettext.gettext found = False for template in self.templates: if (re.search(template.match_uri, source.uri) and |
