403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/babel/messages/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/babel/messages/__pycache__/checkers.cpython-39.opt-1.pyc
a

�4d$�@s�UdZddlmZddlmZddlmZmZmZm	Z	hd�ddhhd�gZ
d	d
dd�d
d�Zd	d
dd�dd�Zdddd�dd�Z
dd�dd�Ze�Zded<dS)z�
    babel.messages.checkers
    ~~~~~~~~~~~~~~~~~~~~~~~

    Various routines that help with validation of translations.

    :since: version 0.9

    :copyright: (c) 2013-2023 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�)�annotations)�Callable)�
PYTHON_FORMAT�Catalog�Message�TranslationError>�d�u�i�x�X>�f�G�F�gzCatalog | Noner�None)�catalog�message�returncCsd|jst|jt�std��dS|dur*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�string�strr�list�tuple�len�num_plurals)rr�msgstrs�r�;/usr/lib/python3.9/site-packages/babel/messages/checkers.pyrs�rcCshd|jvrdS|j}t|ttf�s(|f}|j}t|ttf�sB|f}t||�D]\}}|rLt||�qLdS)z9Verify the format string placeholders in the translation.z
python-formatN)�flags�idrrrr�zip�_validate_format)rrZmsgidsrZmsgidZmsgstrrrr�
python_format.s
r#r)�format�alternativercCs6ddd�dd�}dddd�dd	�}ddd
�dd�}t|||f�\}}t|||f�\}}|rl|sl|sltd
��n||kr|td��|r�t|�t|�kr�td��tt||��D]4\}	\\}
}\}
}|||�s�td|	d||f��q�nTt|�}
|D]F\}}||
v�rtd|����q�|||
|�s�td|||
|f��q�dS)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 formatting.

    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
    rzlist[tuple[str, str]])rrcSsJg}t�|�D]6}|��\}}}|dkr2|dur2q|�|t|�f�q|S)N�%)r�finditer�groups�appendr)r�result�match�namer$�typecharrrr�_parse^sz _validate_format.<locals>._parse�bool)�a�brcSs0||krdStD]}||vr||vrdSqdS)NTF)�_string_format_compatibilities)r0r1�setrrr�_compatiblegsz%_validate_format.<locals>._compatible)�resultsrcSs@d}|D].\}}|dur"|du}q|du|krtd��qt|�S)Nz5format string mixes positional and named placeholders)rr/)r5Z
positionalr,Z_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 zDincompatible format for placeholder %r: %r and %r are not compatibleN)�maprr�	enumerater!�dict)r$r%r.r4r6r0r1Za_positionalZb_positional�idx�_�first�secondZtype_mapr,r-rrrr">s2 	
"
�

�r"z1list[Callable[[Catalog | None, Message], object]])rcCs^g}zddlm}Wnty&Yn 0|�d�D]}|�|���q2t|�dkrZttgS|S)Nr)�working_setzbabel.checkers)	Z
pkg_resourcesr?�ImportErrorZiter_entry_pointsr)�loadrrr#)�checkersr?Zentry_pointrrr�_find_checkers�srCrBN)�__doc__Z
__future__r�collections.abcrZbabel.messages.catalogrrrrr2rr#r"rCrB�__annotations__rrrr�<module>s�_

Youez - 2016 - github.com/yon3zu
LinuXploit