Commit 1c401cb2 authored by Steve Martinelli's avatar Steve Martinelli

use oslo.i18n

Move over to the fancy new oslo i18n library.

Removing openstack/common from all OpenStack code in favor of the
Oslo libraries is a project wide goal for the Ocata release.


Change-Id: I6ec6252b01f04f211602369a6ce6a86bf75e77ad
parent c62ef54c
......@@ -19,7 +19,7 @@ import json
import requests
from climateclient import exception
from climateclient.openstack.common.gettextutils import _ # noqa
from climateclient.i18n import _
class BaseClientManager(object):
......
......@@ -16,7 +16,7 @@
from oslo_utils import importutils
from climateclient import exception
from climateclient.openstack.common.gettextutils import _ # noqa
from climateclient.i18n import _
def Client(version=1, *args, **kwargs):
......
......@@ -14,7 +14,7 @@
# limitations under the License.
from climateclient.openstack.common.gettextutils import _ # noqa
from climateclient.i18n import _
class ClimateClientException(Exception):
......
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""oslo.i18n integration module.
See http://docs.openstack.org/developer/oslo.i18n/usage.html .
"""
import oslo_i18n
_translators = oslo_i18n.TranslatorFactory(domain='climateclient')
# The primary translation function using the well-known name "_"
_ = _translators.primary
# Translators for log levels.
#
# The abbreviated names are meant to reflect the usual use of a short
# name like '_'. The "L" is for "log" and the other letter comes from
# the level.
_LI = _translators.log_info
_LW = _translators.log_warning
_LE = _translators.log_error
_LC = _translators.log_critical
This diff is collapsed.
......@@ -20,7 +20,7 @@ import re
import six
from climateclient import exception
from climateclient.openstack.common.gettextutils import _ # noqa
from climateclient.i18n import _
HEX_ELEM = '[0-9A-Fa-f]'
UUID_PATTERN = '-'.join([HEX_ELEM + '{8}', HEX_ELEM + '{4}',
......
......@@ -14,7 +14,7 @@
# limitations under the License.
from climateclient import base
from climateclient.openstack.common.gettextutils import _ # noqa
from climateclient.i18n import _
class ComputeHostClientManager(base.BaseClientManager):
......
......@@ -16,7 +16,7 @@
from oslo_utils import timeutils
from climateclient import base
from climateclient.openstack.common.gettextutils import _ # noqa
from climateclient.i18n import _
from climateclient import utils
......
......@@ -5,5 +5,6 @@ python-keystoneclient>=0.10.0
requests>=1.2.1
six>=1.7.0
Babel>=1.3
oslo.i18n>=2.1.0 # Apache-2.0
oslo.log>=3.11.0 # Apache-2.0
oslo.utils>=3.18.0 # Apache-2.0
......@@ -20,6 +20,9 @@ builtins = _
ignore = E265,H405
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg
[hacking]
import_exceptions = climateclient.i18n
[testenv:venv]
commands = {posargs}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment