AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/babel/messages/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/babel/messages/__pycache__/checkers.cpython-310.pyc
o

V��\��@sddZddlmZmZddlmZmZhd�ddhhd�gZdd	�Zd
d�Z	dd
�Z
dd�Ze�ZdS)z�
    babel.messages.checkers
    ~~~~~~~~~~~~~~~~~~~~~~~

    Various routines that help with validation of translations.

    :since: version 0.9

    :copyright: (c) 2013-2019 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�)�TranslationError�
PYTHON_FORMAT)�string_types�izip>�d�i�u�x�X>�F�G�f�gcCsd|jst|jt�s
td��dS|durdS|j}t|ttf�s"|f}t|�|jkr0td|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))	�pluralizable�
isinstance�stringrr�list�tuple�len�num_plurals)�catalog�message�msgstrs�r�9/usr/lib/python3/dist-packages/babel/messages/checkers.pyrs��rcCshd|jvrdS|j}t|ttf�s|f}|j}t|ttf�s!|f}t||�D]\}}|r1t||�q&dS)z9Verify the format string placeholders in the translation.z
python-formatN)�flags�idrrrrr�_validate_format)rr�msgidsr�msgid�msgstrrrr�
python_format.s

��r!cCsdd�}dd�}dd�}t|||f�\}}t|||f�\}}|r(|s(|s(td��||kr0td��|rbt|�t|�kr>td	��tt||��D]\}	\\}
}\}
}|||�s_td
|	d||f��qEdSt|�}
|D] \}}||
vrvtd|��|||
|�s�td
|||
|f��qhdS)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
    cSsJg}t�|�D]}|��\}}}|dkr|durq|�|t|�f�q|S)N�%)r�finditer�groups�append�str)r�result�match�name�format�typecharrrr�_parse^sz _validate_format.<locals>._parsecSs0||krdStD]
}||vr||vrdSqdS)NTF)�_string_format_compatibilities)�a�b�setrrr�_compatiblegs�z%_validate_format.<locals>._compatiblecSs@d}|D]\}}|dur|du}q|du|krtd��qt|�S)Nz5format string mixes positional and named placeholders)r�bool)�results�
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,r1r6r.r/�a_positional�b_positional�idx�_�first�second�type_mapr)r+rrrr>s: 	"
���	���rcCs^g}zddlm}Wn	tyYnw|�d�D]	}|�|���qt|�dkr-ttgS|S)Nr)�working_setzbabel.checkers)	�
pkg_resourcesrC�ImportError�iter_entry_pointsr%�loadrrr!)�checkersrC�entry_pointrrr�_find_checkers�s�rJN)
�__doc__�babel.messages.catalogrr�
babel._compatrrr-rr!rrJrHrrrr�<module>s�_


Anon7 - 2022
AnonSec Team