/usr/lib/python2.6/site-packages/cinderclient/openstack/common
Edit: /usr/lib/python2.6/site-packages/cinderclient/openstack/common/gettextutils.pyc (16762B)
Ñò
=vVc
@ s& d Z d d k Z d d k Z d d k Z d d k l Z d d k Z d d k l Z d d k Z h Z
e a d e
f d „ ƒ YZ e d ƒ Z e i Z e i Z e i Z e i Z e i Z d „ Z d „ Z d
e i f d „ ƒ YZ d „ Z d d
„ Z d d „ Z! d e i" f d „ ƒ YZ# d S( s„
gettext for openstack-common modules.
Usual usage in an openstack.common module:
from openstack.common.gettextutils import _
iÿÿÿÿN( t handlers( t
localedatat TranslatorFactoryc B sz e Z d Z d d „ Z d d „ Z e d „ ƒ Z d „ Z e d „ ƒ Z e d „ ƒ Z
e d „ ƒ Z e d „ ƒ Z RS(
s Create translator functions
c C sC | | _ | d j o t i i | i ƒ d ƒ } n | | _ d S( s¨ Establish a set of translation functions for the domain.
:param domain: Name of translation domain,
specifying a message catalog.
:type domain: str
:param lazy: Delays translation until a message is emitted.
Defaults to False.
:type lazy: Boolean
:param localedir: Directory with translation catalogs.
:type localedir: str
t
_LOCALEDIRN( t domaint Nonet ost environt gett uppert localedir( t selfR R
( ( sW /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/gettextutils.pyt __init__, s
c sk ˆ d j o
| i ‰ n t i ˆ d | i d t ƒ} t i o
| i n | i ‰ ‡ ‡ f d † } | S( s¨ Return a new translation function ready for use.
Takes into account whether or not lazy translation is being
done.
The domain can be specified to override the default from the
factory, but the localedir from the factory is always used
because we assume the log-level translation catalogs are
installed in the same directory as the main application
catalog.
R
t fallbackc s" t o t | d ˆ ƒSˆ | ƒ S( s, oslo.i18n.gettextutils translation function.R ( t USE_LAZYt Message( t msg( t mR ( sW /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/gettextutils.pyt fS s N( R R t gettextt translationR
t Truet sixt PY3t ugettext( R R t tR ( ( R R sW /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/gettextutils.pyt _make_translation_func= s
c C s
| i ƒ S( s! The default translation function.( R ( R ( ( sW /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/gettextutils.pyt primaryZ s c C s | i | i d | ƒ S( Ns -log-( R R ( R t level( ( sW /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/gettextutils.pyt _make_log_translation_func_ s c C s
| i d ƒ S( s" Translate info-level log messages.t info( R ( R ( ( sW /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/gettextutils.pyt log_infob s c C s
| i d ƒ S( s% Translate warning-level log messages.t warning( R ( R ( ( sW /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/gettextutils.pyt log_warningg s c C s
| i d ƒ S( s# Translate error-level log messages.t error( R ( R ( ( sW /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/gettextutils.pyt log_errorl s c C s
| i d ƒ S( s&