/usr/lib/python2.6/site-packages/oslo_i18n
NameSizeModeActions
locale/-0755rm
tests/-0755rm
fixture.py56740644editdlrm
fixture.pyc73980644editdlrm
log.py35420644editdlrm
log.pyc28730644editdlrm
_factory.py70460644editdlrm
_factory.pyc72930644editdlrm
_gettextutils.py29800644editdlrm
_gettextutils.pyc27820644editdlrm
_i18n.py9340644editdlrm
_i18n.pyc3690644editdlrm
_lazy.py12660644editdlrm
_lazy.pyc8570644editdlrm
_locale.py9350644editdlrm
_locale.pyc5580644editdlrm
_message.py92600644editdlrm
_message.pyc67620644editdlrm
_translate.py28710644editdlrm
_translate.pyc25540644editdlrm
__init__.py6730644editdlrm
__init__.pyc2580644editdlrm
Edit: /usr/lib/python2.6/site-packages/oslo_i18n/fixture.pyc (7398B)
Ñò yDVc@s»dZddkZddkZddkZddklZddklZdeifd„ƒYZdeifd„ƒYZ d ei fd „ƒYZ d „Z d eifd „ƒYZ dS(s+Test fixtures for working with oslo_i18n. iÿÿÿÿN(t_lazy(t_messaget TranslationcBs,eZdZdd„Zd„Zd„ZRS(sFixture for managing translatable strings. This class provides methods for creating translatable strings using both lazy translation and immediate translation. It can be used to generate the different types of messages returned from oslo_i18n to test code that may need to know about the type to handle them differently (for example, error handling in WSGI apps, or logging). Use this class to generate messages instead of toggling the global lazy flag and using the regular translation factory. s test-domaincCs ||_dS(síInitialize the fixture. :param domain: The translation domain. This is not expected to coincide with an actual set of message catalogs, but it can. :type domain: str N(tdomain(tselfR((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyt__init__(scCsti|d|iƒS(s×Return a lazily translated message. :param msg: Input message string. May optionally include positional or named string interpolation markers. :type msg: str or unicode R(RtMessageR(Rtmsg((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pytlazy2scCs ti|ƒS(sñReturn a string as though it had been translated immediately. :param msg: Input message string. May optionally include positional or named string interpolation markers. :type msg: str or unicode (tsixt text_type(RR((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyt immediate<s(t__name__t __module__t__doc__RRR (((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyRs  t ToggleLazycBs)eZdZd„Zd„Zd„ZRS(s8Fixture to toggle lazy translation on or off for a test.cCs,tt|ƒiƒ||_ti|_dS(sÕForce lazy translation on or off. :param enabled: Flag controlling whether to enable or disable lazy translation, passed to :func:`~oslo_i18n.enable_lazy`. :type enabled: bool N(tsuperRRt_enabledRtUSE_LAZYt_original_value(Rtenabled((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyRJs cCs7tt|ƒiƒ|i|iƒti|iƒdS(N(RRtsetUpt addCleanupt_restore_originalRt enable_lazyR(R((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyRUscCsti|iƒdS(N(RRR(R((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyRZs(R R RRRR(((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyRGs t_PrefixTranslatorcBs/eZdZddd„Zd„Zd„ZRS(s÷Translator that adds prefix to message ids NOTE: gettext.NullTranslations is an old style class :parm prefix: prefix to add to message id. If not specified (None) then 'noprefix' is used. :type prefix: string tnoprefixcCs tii||ƒ||_dS(N(tgettexttNullTranslationsRtprefix(RtfpR((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyRiscCs tii||ƒ}|i|S(N(RRR(RtmessageR((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyRmscCs tii||ƒ}|i|S(N(RRtugettextR(RRR((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyR qsN(R R RtNoneRRR (((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyR^s  cOs%td|dd|dddƒS(sEUse message id prefixed with domain and language as translation Rit/t languagess: (R(txty((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyt_prefix_translationsvstPrefixLazyTranslationcBs)eZdZdZdd„Zd„ZRS(sHFixture to prefix lazy translation enabled messages Use of this fixture will cause messages supporting lazy translation to be replaced with the message id prefixed with 'domain/language:'. For example, 'oslo/en_US: message about something'. It will also override the available languages returned from oslo_18n.get_available_languages to the specified languages. This will enable tests to ensure that messages were translated lazily with the specified language and not immediately with the default language. NOTE that this does not work unless lazy translation is enabled, so it uses the ToggleLazy fixture to enable lazy translation. :param languages: list of languages to support. If not specified (None) then ['en_US'] is used. :type languages: list of strings ten_UScCs-tt|ƒiƒ|p tig|_dS(N(RR'Rt _DEFAULT_LANGR#(RR#((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyR”scs©ttˆƒiƒˆittƒƒˆitid‡fd†ƒƒˆitid‡fd†ƒƒˆitid‡fd†ƒƒˆitidtƒƒdS(Ns/oslo_i18n._gettextutils.get_available_languagescsˆiS((R#(R$R%(R(s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pytss!oslo_i18n.get_available_languagescsˆiS((R#(R$R%(R(s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyR* scsˆiS((R#(R$R%(R(s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyR*£ssgettext.translation( RR'Rt useFixtureRtTruetfixturest MonkeyPatchR&(R((Rs4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyR˜s   N(R R RR)R!RR(((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyR'}s (RRR-R t oslo_i18nRRtFixtureRRRRR&R'(((s4/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/fixture.pyts   .