/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/log.pyc (2873B)
Ņō yDVc@sCdZddklZddklZdeifd„ƒYZdS(s"logging utilities for translation i˙˙˙˙(thandlers(t _translatetTranslationHandlercBs8eZdZddd„Zd„Zd„Zd„ZRS(sHandler that translates records before logging them. When lazy translation is enabled in the application (see :func:`~oslo_i18n.enable_lazy`), the :class:`TranslationHandler` uses its locale configuration setting to determine how to translate LogRecord objects before forwarding them to the logging.Handler. When lazy translation is disabled, the message in the LogRecord is converted to unicode without any changes and then forwarded to the logging.Handler. The handler can be configured declaratively in the ``logging.conf`` as follows:: [handlers] keys = translatedlog, translator [handler_translatedlog] class = handlers.WatchedFileHandler args = ('/var/log/api-localized.log',) formatter = context [handler_translator] class = oslo_i18n.log.TranslationHandler target = translatedlog args = ('zh_CN',) If the specified locale is not available in the system, the handler will log in the default locale. cCs)tii|ddd|ƒ||_dS(sŪInitialize a TranslationHandler :param locale: locale to use for translating messages :param target: logging.Handler object to forward LogRecord objects to after translation tcapacityittargetN(Rt MemoryHandlert__init__tlocale(tselfRR((s0/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyR;s cCs|ii|ƒdS(N(Rt setFormatter(Rtfmt((s0/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyR JscCs=|i}|i}z|i|ƒWd||_||_XdS(N(tmsgtargst_translate_and_log_record(Rtrecordt original_msgt original_args((s0/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pytemitMs    cCsJti|i|iƒ|_ti|i|iƒ|_|ii|ƒdS(N(Rt translateR Rttranslate_argsR RR(RR((s0/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyR YsN(t__name__t __module__t__doc__tNoneRR RR (((s0/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyRs    N(RtloggingRt oslo_i18nRRR(((s0/tmp/pip-build-lt8jXN/oslo.i18n/oslo_i18n/log.pyts