403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.188.131.162
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3.6/site-packages/babel/messages/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/babel/messages/__pycache__/checkers.cpython-36.pyc
3

4\0X��@svdZddlmZmZddlmZmZedddg�eddg�ed	d
ddg�gZd
d�Z	dd�Z
dd�Zdd�Ze�Z
dS)z�
    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.
�)�TranslationError�
PYTHON_FORMAT)�string_types�izip�i�d�u�x�X�f�F�g�GcCsd|jst|jt�std��dS|dkr*dS|j}t|ttf�sD|f}t|�|jkr`td|j��dS)z0Verify the number of plurals in the translation.z/Found plural forms for non-pluralizable messageNz*Wrong number of plural forms (expected %d))	Zpluralizable�
isinstance�stringrr�list�tuple�len�num_plurals)�catalog�message�msgstrs�r�/usr/lib/python3.6/checkers.pyrsrcCsld|jkrdS|j}t|ttf�s(|f}|j}t|ttf�sB|f}x$t||�D]\}}|rNt||�qNWdS)z9Verify the format string placeholders in the translation.z
python-formatN)�flags�idrrrrr�_validate_format)rrZmsgidsrZmsgidZmsgstrrrr�
python_format.s
rcCs$dd�}dd�}dd�}t|||f�\}}t|||f�\}}|rV|rV|rVtd��n||krftd��|r�t|�t|�kr�td	��x�tt||��D]4\}	\\}
}\}
}|||�s�td
|	d||f��q�WnTt|�}
xJ|D]B\}}||
kr�td|��q�|||
|�s�td
|||
|f��q�WdS)a�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
    cSsNg}xDtj|�D]6}|j�\}}}|dkr4|dkr4q|j|t|�f�qW|S)N�%)r�finditer�groups�append�str)r�result�match�name�format�typecharrrr�_parse^sz _validate_format.<locals>._parsecSs2||krdSx tD]}||kr||krdSqWdS)NTF)�_string_format_compatibilities)�a�b�setrrr�_compatiblegs
z%_validate_format.<locals>._compatiblecSsDd}x6|D].\}}|dkr$|dk}q
|dk|kr
td��q
Wt|�S)Nz5format string mixes positional and named placeholders)r�bool)�resultsZ
positionalr%�charrrr�_check_positionalos
z+_validate_format.<locals>._check_positionalzplaceholders are incompatiblez)the format strings are of different kindsz-positional format placeholders are unbalancedzDincompatible format for placeholder %d: %r and %r are not compatible�zunknown named placeholder %rzDincompatible format for placeholder %r: %r and %r are not compatibleN)�maprr�	enumerater�dict)r&�alternativer(r-r1r*r+Za_positionalZb_positional�idx�_�first�secondZtype_mapr%r'rrrr>s. 	
$
rcCsdg}yddlm}Wntk
r(Yn$Xx |jd�D]}|j|j��q6Wt|�dkr`ttgS|S)Nr)�working_setzbabel.checkers)	Z
pkg_resourcesr;�ImportErrorZiter_entry_pointsr!�loadrrr)�checkersr;Zentry_pointrrr�_find_checkers�sr?N)�__doc__Zbabel.messages.catalogrrZ
babel._compatrrr,r)rrrr?r>rrrr�<module>s
_

Youez - 2016 - github.com/yon3zu
LinuXploit