/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/_message.pyc (6762B)
Ñò yDVc @s dZddkZddkZddkZddkZddkZddkZddklZddkl Z dZ ei e ƒZ deifd„ƒYZdS(s4Private Message class for lazy translation support. iÿÿÿÿN(t_locale(t _translatestMessagecBs—eZdZd d deed„Zd d„Zed eed„ƒZd„Z d„Z d„Z d„Z d „Z d „Zeio d „ZnRS( sýA Message object is a unicode object that can be translated. Translation of Message is done explicitly using the translate() method. For all non-translation intents and purposes, a Message is simply unicode, and can be treated as such. tosloc Gsi|pti||ƒ}ntt|ƒi||ƒ}||_||_||_||_||_|S(s&Create a new Message object. In order for translation to work gettext requires a message ID, this msgid will be used as the base unicode text. It is also possible for the msgid and the base unicode text to be different by passing the msgtext parameter. ( Rt_translate_msgidtsupert__new__tmsgidtdomaintparamsthas_contextual_formthas_plural_form( tclsRtmsgtextR RR R targstmsg((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyR-s      cCsati|i|i||i|iƒ}|idjo|Sti |i|ƒ}|i ||ƒS(sQTranslate this message to the desired locale. :param desired_locale: The desired locale to translate the message to, if no locale is provided the message will be translated to the system's default locale. :returns: the translated message in unicode N( RRRRR R R tNoneRttranslate_argst_safe_translate(tselftdesired_localettranslated_messagettranslated_params((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyt translateFs    cCsy|p!tiƒ}|dpd}ntiiti|ƒƒ}ti|d|d|gdt ƒ}| o5| o-t i o |in|i }||ƒ} nÒ|o|ot dƒ‚n´|oc|\} } t i o |in|i }d| t| f} || ƒ} t| jo | } qunJ|oB|\} }}t i o |in|i}|| ||ƒ} n| S(Niten_USt localedirt languagestfallbacksUnimplemented.s%s%s%s(tlocaletgetdefaultlocaletostenvirontgetRtget_locale_dir_variable_nametgettextt translationtTruetsixtPY3tugettextt ValueErrortCONTEXT_SEPARATORtngettextt ungettext(RRRR R t system_localet locale_dirtlangt translatorRtmsgctxtmsgtxtt msg_with_ctxt msgsinglet msgpluraltmsgcount((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyRcs4        cCsVy||}WnAttfj o/}tid||i|ƒ|i|}nX|S(NuQFailed to insert replacement values into translated message %s (Original: %r): %s(tKeyErrort TypeErrortLOGtdebugR(RRRterr((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyRs cCsR|i|ƒ}|iti|ƒ|ƒ}t|id|d|d|iƒ}|S(NR R R(t_sanitize_mod_paramsRR%t text_typeRRR(RtotherR t unicode_modtmodded((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyt__mod__£s  cs§|djo |f}nŠt|tƒojh}tˆitƒo*|i‡fd†ˆiiƒDƒƒn|i‡fd†|iƒDƒƒnˆi|ƒ}|S(sšSanitize the object being modded with this Message. - Add support for modding 'None' so translation supports it - Trim the modded object, which can be a large dictionary, to only those keys that would actually be used in a translation - Snapshot the object being modded, in case the message is translated, it will be used as it was when the Message was created c3s.x'|] \}}|ˆi|ƒfVqWdS(N(t _copy_param(t.0tkeytval(R(s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pys ¿s c3s.x'|] \}}|ˆi|ƒfVqWdS(N(RA(RBRCRD(R(s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pys Ás N(Rt isinstancetdictR tupdatetitemsRA(RR=R ((Rs5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyR;¯s  cCs5yti|ƒSWntj oti|ƒSXdS(N(tcopytdeepcopyt ExceptionR%R<(Rtparam((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyRAÇscCs,ddkl}|dƒ}t|ƒ‚dS(Niÿÿÿÿ(t_s(Message objects do not support addition.(toslo_i18n._i18nRMR7(RR=RMR((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyt__add__Ïs cCs |i|ƒS(N(RO(RR=((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyt__radd__ÔscCs,ddkl}|dƒ}t|ƒ‚dS(Niÿÿÿÿ(RMs€Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.(RNRMt UnicodeError(RRMR((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyt__str__Øs N(t__name__t __module__t__doc__RtFalseRRt staticmethodRRR@R;RARORPR%tPY2RR(((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyR%s   *      (RURIR"RtloggingRR%t oslo_i18nRRR)t getLoggerRSR8R<R(((s5/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/_message.pyts