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__/mofile.cpython-39.pyc
a

�4d��@s�UdZddlmZddlZddlZddlmZddlmZm	Z	erRddl
mZmZdZ
ded	<d
Zded<dd
d�dd�Zddd
ddd�dd�ZdS)z�
    babel.messages.mofile
    ~~~~~~~~~~~~~~~~~~~~~

    Writing of files in the ``gettext`` MO (machine object) format.

    :copyright: (c) 2013-2023 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�)�annotationsN)�
TYPE_CHECKING)�Catalog�Message)�SupportsRead�
SupportsWritel�*�int�LE_MAGICl�$<�BE_MAGICzSupportsRead[bytes]r)�fileobj�returncslt��i}t|dd�}|��}t|�}tj}|d|dd��d}|tkrj|d|dd��\}}}	}
d	}n4|tkr�|d
|dd��\}}}	}
d}ntdd|��t	|�D�]�}||||	|	d
��\}
}||
}||||
|
d
��\}}||}||k�r||k�r|||�}|||�}ntdd|��|
dk�r�d}}|�
�D]j}|��}|�sZ�qDd|v�r�|�dd�\}}|���
�}}|��||<n|�rD||d|7<�qDd|v�r�|�d�\}}nd}d|v�r|�d�}|�d�}�j�r:�fdd�|D�}�fdd�|D�}n �j�r:|��j�}|��j�}t|||d��|<|	d
7}	|
d
7}
q�|���_�S)aaRead a binary MO file from the given file-like object and return a
    corresponding `Catalog` object.

    :param fileobj: the file-like object to read the MO file from

    :note: The implementation of this function is heavily based on the
           ``GNUTranslations._parse`` method of the ``gettext`` module in the
           standard library.
    �name�z<IN�rz<4I�z<IIz>4Iz>IIzBad magic number�zFile is corrupt�:��
��csg|]}|��j��qS���decode�charset��.0�x��catalogr�9/usr/lib/python3.9/site-packages/babel/messages/mofile.py�
<listcomp>]�zread_mo.<locals>.<listcomp>csg|]}|��j��qSrrrrrr r!^r")�context)r�getattr�read�len�struct�unpackr	r
�OSError�range�
splitlines�strip�split�lowerrrr�itemsZmime_headers)rZheaders�filename�buf�buflenr(�magic�version�msgcountZorigidx�transidx�iiZ_i�mlen�moff�mend�tlen�toff�tend�msg�tmsgZlastkey�key�item�valueZctxtrrr �read_mosh








rCFzSupportsWrite[bytes]�bool�None)rr�	use_fuzzyrcs�t��}�fdd�|dd�D�|dd�<|��d}}g}|D]�}|jr�d��fdd�|jD��}g}	t|j�D]2\}
}|s�|	�|jtt	|
�d��qt|	�|�qtd��fdd�|	D��}n|j�
�j�}|j�
�j�}|jr�d	�|j�
�j�|g�}|�t
|�t
|�t
|�t
|�f�||d7}||d7}qBd
dt
|�}
|
t
|�}g}g}|D].\}}}}||||
g7}||||g7}�q`||}|�t�dtd
t
|�d
d
t
|�dd
d
�tj�t�d|��||�dS)a�Write a catalog to the specified file-like object using the GNU MO file
    format.

    >>> import sys
    >>> from babel.messages import Catalog
    >>> from gettext import GNUTranslations
    >>> from io import BytesIO

    >>> catalog = Catalog(locale='en_US')
    >>> catalog.add('foo', 'Voh')
    <Message ...>
    >>> catalog.add((u'bar', u'baz'), (u'Bahr', u'Batz'))
    <Message ...>
    >>> catalog.add('fuz', 'Futz', flags=['fuzzy'])
    <Message ...>
    >>> catalog.add('Fizz', '')
    <Message ...>
    >>> catalog.add(('Fuzz', 'Fuzzes'), ('', ''))
    <Message ...>
    >>> buf = BytesIO()

    >>> write_mo(buf, catalog)
    >>> x = buf.seek(0)
    >>> translations = GNUTranslations(fp=buf)
    >>> if sys.version_info[0] >= 3:
    ...     translations.ugettext = translations.gettext
    ...     translations.ungettext = translations.ngettext
    >>> translations.ugettext('foo')
    u'Voh'
    >>> translations.ungettext('bar', 'baz', 1)
    u'Bahr'
    >>> translations.ungettext('bar', 'baz', 2)
    u'Batz'
    >>> translations.ugettext('fuz')
    u'fuz'
    >>> translations.ugettext('Fizz')
    u'Fizz'
    >>> translations.ugettext('Fuzz')
    u'Fuzz'
    >>> translations.ugettext('Fuzzes')
    u'Fuzzes'

    :param fileobj: the file-like object to write to
    :param catalog: the `Catalog` instance
    :param use_fuzzy: whether translations marked as "fuzzy" should be included
                      in the output
    cs g|]}|jr�s|js|�qSr)�stringZfuzzy)r�m)rFrr r!�s�zwrite_mo.<locals>.<listcomp>rNr"rcsg|]}|��j��qSr��encoder)r�msgidrrr r!�scsg|]}|��j��qSrrI)r�msgstrrrr r!�sr��ZIiiiiiirr�i)�list�sortZpluralizable�join�id�	enumeraterG�append�minrrJrr#r&�writer'�packr	�array�tobytes)rrrF�messagesZidsZstrsZoffsets�messagerKZmsgstrs�idxrGrLZkeystartZ
valuestartZkoffsetsZvoffsetsZo1�l1Zo2�l2r)rrFr �write_momsb0"��
�"
����r`)F)�__doc__Z
__future__rrYr'�typingrZbabel.messages.catalogrrZ	_typeshedrrr	�__annotations__r
rCr`rrrr �<module>s	T

Youez - 2016 - github.com/yon3zu
LinuXploit