Remove gettext magic and import _ explicitly
Instead of magically loading `_` into python built-in globals, import it explicitly where needed. Partially-implements: py3k-support Change-Id: Icfedf9f86ead81bbee038506a91c456907af0d05
This commit is contained in:
parent
ec18885d96
commit
eef012d4c4
@ -20,8 +20,6 @@ try:
|
||||
_sys.stderr.write('Running from marconi source directory.\n')
|
||||
del _sys
|
||||
except NameError:
|
||||
import gettext
|
||||
gettext.install('marconi', unicode=1)
|
||||
import marconi.queues.bootstrap
|
||||
Bootstrap = marconi.queues.bootstrap.Bootstrap
|
||||
|
||||
|
@ -17,6 +17,7 @@ import jsonschema
|
||||
from jsonschema import validators
|
||||
|
||||
from marconi.common import errors
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
from marconi.openstack.common import log
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
@ -21,6 +21,7 @@ import os
|
||||
import sys
|
||||
import termios
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
from marconi.openstack.common import log as logging
|
||||
|
||||
|
||||
|
@ -33,6 +33,7 @@ them do, an AttributeError exception will be raised.
|
||||
import six
|
||||
|
||||
from marconi.common import decorators
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
import falcon
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.queues.transport import validation
|
||||
|
||||
|
@ -19,6 +19,7 @@ from stevedore import driver
|
||||
from marconi.common.cache import cache as oslo_cache
|
||||
from marconi.common import decorators
|
||||
from marconi.common import errors
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
from marconi.openstack.common import log
|
||||
from marconi.queues.storage import pipeline
|
||||
from marconi.queues.storage import sharding
|
||||
|
@ -27,6 +27,7 @@ import time
|
||||
import pymongo.errors
|
||||
import pymongo.read_preferences
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.openstack.common import timeutils
|
||||
from marconi.queues import storage
|
||||
|
@ -23,6 +23,7 @@ Field Mappings:
|
||||
|
||||
import pymongo.errors
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.openstack.common import timeutils
|
||||
from marconi.queues import storage
|
||||
|
@ -19,6 +19,7 @@ from stevedore import driver
|
||||
|
||||
from marconi import common
|
||||
from marconi.common import decorators
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
from marconi.openstack.common import log as logging
|
||||
from marconi.queues.storage import base
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
from keystoneclient.middleware import auth_token
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
from marconi.openstack.common import log
|
||||
|
||||
|
||||
@ -40,7 +41,7 @@ class KeystoneAuth(object):
|
||||
@classmethod
|
||||
def install(cls, app, conf):
|
||||
"""Install Auth check on application."""
|
||||
LOG.debug(_(u"Installing Keystone's auth protocol"))
|
||||
LOG.debug(_(u'Installing Keystone\'s auth protocol'))
|
||||
cls._register_opts(conf)
|
||||
conf = dict(conf.get(cls.OPT_GROUP_NAME))
|
||||
return auth_token.AuthProtocol(app, conf=conf)
|
||||
|
@ -16,6 +16,7 @@
|
||||
import falcon
|
||||
import six
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.queues.storage import errors as storage_errors
|
||||
from marconi.queues.transport import utils
|
||||
|
@ -24,6 +24,7 @@ import six
|
||||
from marconi.common import decorators
|
||||
from marconi.common.transport import version
|
||||
from marconi.common.transport.wsgi import helpers
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.queues import transport
|
||||
from marconi.queues.transport import auth, validation
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
import falcon
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
|
||||
|
||||
class HTTPServiceUnavailable(falcon.HTTPServiceUnavailable):
|
||||
"""Wraps falcon.HTTPServiceUnavailable with Marconi messaging."""
|
||||
|
@ -16,6 +16,7 @@
|
||||
import falcon
|
||||
import six
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.queues.storage import errors as storage_errors
|
||||
from marconi.queues.transport import utils
|
||||
|
@ -16,6 +16,7 @@
|
||||
import falcon
|
||||
import six
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.queues.storage import errors as storage_errors
|
||||
from marconi.queues.transport import utils
|
||||
|
@ -16,6 +16,7 @@
|
||||
import falcon
|
||||
import six
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.queues.transport import utils
|
||||
from marconi.queues.transport import validation
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
import falcon
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.queues.storage import errors as storage_errors
|
||||
from marconi.queues.transport import utils
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
import uuid
|
||||
|
||||
from marconi.openstack.common.gettextutils import _
|
||||
import marconi.openstack.common.log as logging
|
||||
from marconi.queues.transport import utils
|
||||
from marconi.queues.transport.wsgi import errors
|
||||
|
5
tox.ini
5
tox.ini
@ -31,5 +31,8 @@ setenv = NOSE_WITH_COVERAGE=1
|
||||
commands = {posargs}
|
||||
|
||||
[flake8]
|
||||
builtins = _,__MARCONI_SETUP__
|
||||
builtins = __MARCONI_SETUP__
|
||||
exclude = .venv*,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*.egg,.update-venv
|
||||
|
||||
[hacking]
|
||||
import_exceptions = marconi.openstack.common.gettextutils._
|
||||
|
Loading…
Reference in New Issue
Block a user