Merge "Remove gettext.install from quantumclient.__init__"
This commit is contained in:
@@ -15,9 +15,3 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
# @author: Tyler Smith, Cisco Systems
|
# @author: Tyler Smith, Cisco Systems
|
||||||
|
|
||||||
import gettext
|
|
||||||
|
|
||||||
|
|
||||||
# gettext must be initialized before any quantumclient imports
|
|
||||||
gettext.install('quantumclient', unicode=1)
|
|
||||||
|
@@ -14,3 +14,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
# @author: Somik Behera, Nicira Networks, Inc.
|
# @author: Somik Behera, Nicira Networks, Inc.
|
||||||
|
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
t = gettext.translation('quantumclient', fallback=True)
|
||||||
|
|
||||||
|
|
||||||
|
def _(msg):
|
||||||
|
return t.ugettext(msg)
|
||||||
|
@@ -15,6 +15,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from quantumclient.common import _
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Quantum base exception handling.
|
Quantum base exception handling.
|
||||||
"""
|
"""
|
||||||
|
@@ -33,7 +33,6 @@ from quantumclient.common import exceptions as exc
|
|||||||
from quantumclient.common import utils
|
from quantumclient.common import utils
|
||||||
|
|
||||||
|
|
||||||
gettext.install('quantum', unicode=1)
|
|
||||||
VERSION = '2.0'
|
VERSION = '2.0'
|
||||||
QUANTUM_API_VERSION = '2.0'
|
QUANTUM_API_VERSION = '2.0'
|
||||||
|
|
||||||
@@ -564,6 +563,7 @@ class QuantumShell(App):
|
|||||||
|
|
||||||
|
|
||||||
def main(argv=sys.argv[1:]):
|
def main(argv=sys.argv[1:]):
|
||||||
|
gettext.install('quantumclient', unicode=1)
|
||||||
try:
|
try:
|
||||||
return QuantumShell(QUANTUM_API_VERSION).run(argv)
|
return QuantumShell(QUANTUM_API_VERSION).run(argv)
|
||||||
except exc.QuantumClientException:
|
except exc.QuantumClientException:
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
# Copyright 2013 OpenStack LLC.
|
||||||
|
# All Rights Reserved
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
|
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
# Because we installed '_' for quantum cli in shell.py, this help unittest
|
||||||
|
# have definition of '_'
|
||||||
|
gettext.install('quantumclient', unicode=1)
|
||||||
|
@@ -21,6 +21,7 @@ import time
|
|||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from quantumclient.client import HTTPClient
|
from quantumclient.client import HTTPClient
|
||||||
|
from quantumclient.common import _
|
||||||
from quantumclient.common import exceptions
|
from quantumclient.common import exceptions
|
||||||
from quantumclient.common.serializer import Serializer
|
from quantumclient.common.serializer import Serializer
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user