/usr/lib/python2.6/site-packages/babel/messages
NameSizeModeActions
catalog.py310610644editdlrm
catalog.pyc303970644editdlrm
checkers.py60940644editdlrm
checkers.pyc56910644editdlrm
extract.py226950644editdlrm
extract.pyc174330644editdlrm
frontend.py522120644editdlrm
frontend.pyc422090644editdlrm
jslexer.py53170644editdlrm
jslexer.pyc51870644editdlrm
mofile.py69530644editdlrm
mofile.pyc55890644editdlrm
plurals.py66960644editdlrm
plurals.pyc66240644editdlrm
pofile.py163200644editdlrm
pofile.pyc145690644editdlrm
__init__.py2490644editdlrm
__init__.pyc3990644editdlrm
Edit: /usr/lib/python2.6/site-packages/babel/messages/checkers.pyc (5691B)
Ñò zDVc @sŸdZddklZlZddklZlZedddgƒeddgƒed d d d gƒgZd „Z d„Z d„Z d„Z e ƒZ dS(sñ babel.messages.checkers ~~~~~~~~~~~~~~~~~~~~~~~ Various routines that help with validation of translations. :since: version 0.9 :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. iÿÿÿÿ(tTranslationErrort PYTHON_FORMAT(t string_typestiziptitdtutxtXtftFtgtGcCs¡|ip(t|itƒptdƒ‚ndS|djodS|i}t|ttfƒp |f}nt|ƒ|i jotd|i ƒ‚ndS(s0Verify the number of plurals in the translation.s/Found plural forms for non-pluralizable messageNs*Wrong number of plural forms (expected %d)( t pluralizablet isinstancetstringRRtNonetlistttupletlent num_plurals(tcatalogtmessagetmsgstrs((s6/tmp/pip-build-lt8jXN/Babel/babel/messages/checkers.pyRs    cCs©d|ijodS|i}t|ttfƒp |f}n|i}t|ttfƒp |f}nx5t||ƒD]$\}}|ot||ƒq}q}WdS(s9Verify the format string placeholders in the translation.s python-formatN(tflagstidRRRRRt_validate_format(RRtmsgidsRtmsgidtmsgstr((s6/tmp/pip-build-lt8jXN/Babel/babel/messages/checkers.pyt python_format.s     cCs¯d„}d„}d„}t|||fƒ\}}t|||fƒ\}}|o | o| otdƒ‚n||jotdƒ‚n|o–t|ƒt|ƒjotdƒ‚nxãtt||ƒƒD]O\} \\} } \} } || | ƒp!td| d| | fƒ‚qÛqÛWnzt|ƒ} xj|D]b\}}|| jotd |ƒ‚qE||| |ƒp!td ||| |fƒ‚qEqEWd S( s‹Test format string `alternative` against `format`. `format` can be the msgid of a message and `alternative` one of the `msgstr`\s. The two arguments are not interchangeable as `alternative` may contain less placeholders if `format` uses named placeholders. The behavior of this function is undefined if the string does not use string formattings. If the string formatting of `alternative` is compatible to `format` the function returns `None`, otherwise a `TranslationError` is raised. Examples for compatible format strings: >>> _validate_format('Hello %s!', 'Hallo %s!') >>> _validate_format('Hello %i!', 'Hallo %d!') Example for an incompatible format strings: >>> _validate_format('Hello %(name)s!', 'Hallo %s!') Traceback (most recent call last): ... TranslationError: the format strings are of different kinds This function is used by the `python_format` checker. :param format: The original format string :param alternative: The alternative format string that should be checked against format :raises TranslationError: on formatting errors cSssg}xfti|ƒD]U}|iƒ\}}}|djo|djoqn|i|t|ƒfƒqW|S(Nt%(RtfinditertgroupsRtappendtstr(Rtresulttmatchtnametformatttypechar((s6/tmp/pip-build-lt8jXN/Babel/babel/messages/checkers.pyt_parse^scSsF||jotSx-tD]%}||jo||jotSqWtS(N(tTruet_string_format_compatibilitiestFalse(tatbtset((s6/tmp/pip-build-lt8jXN/Babel/babel/messages/checkers.pyt _compatiblegs  cSsgd}xT|D]L\}}|djo|dj}q |dj|jotdƒ‚q q Wt|ƒS(Ns5format string mixes positional and named placeholders(RRtbool(tresultst positionalR&tchar((s6/tmp/pip-build-lt8jXN/Babel/babel/messages/checkers.pyt_check_positionalos  splaceholders are incompatibles)the format strings are of different kindss-positional format placeholders are unbalancedsDincompatible format for placeholder %d: %r and %r are not compatibleisunknown named placeholder %rsDincompatible format for placeholder %r: %r and %r are not compatibleN(tmapRRt enumerateRtdict(R't alternativeR)R0R5R-R.t a_positionalt b_positionaltidxt_tfirsttsecondttype_mapR&R(((s6/tmp/pip-build-lt8jXN/Babel/babel/messages/checkers.pyR>s2   #   cCsg}yddkl}Wntj on/Xx*|idƒD]}|i|iƒƒq@Wt|ƒdjo ttgS|S(Niÿÿÿÿ(t working_setsbabel.checkersi( t pkg_resourcesRAt ImportErrortiter_entry_pointsR"tloadRRR(tcheckersRAt entry_point((s6/tmp/pip-build-lt8jXN/Babel/babel/messages/checkers.pyt_find_checkerss N(t__doc__tbabel.messages.catalogRRt babel._compatRRR/R+RRRRHRF(((s6/tmp/pip-build-lt8jXN/Babel/babel/messages/checkers.pyt s   _