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 :  /usr/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 : /usr/lib/python3/dist-packages/babel/messages/__pycache__/mofile.cpython-310.pyc
o

V��\$�@sRdZddlZddlZddlmZmZddlmZmZdZ	dZ
dd�Zdd
d�ZdS)
z�
    babel.messages.mofile
    ~~~~~~~~~~~~~~~~~~~~~

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

    :copyright: (c) 2013-2019 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�N)�Catalog�Message)�
range_type�
array_tobytesl�*l�$<csZt��i}t|dd�}|��}t|�}tj}|d|dd��d}|tkr5|d|dd��\}}}	}
d	}n|tkrI|d
|dd��\}}}	}
d}ntdd|��t	d|�D]�}||||	|	d
��\}
}||
}||||
|
d
��\}}||}||kr�||kr�|||�}|||�}ntdd|��|
dkr�d}}|�
�D]0}|��}|s�q�d|vr�|�dd�\}}|���
�}}|��||<q�|r�||d|7<q�d|vr�|�d�\}}nd}d|v�r|�d�}|�d�}�j�r�fdd�|D�}�fdd�|D�}n�j�r|��j�}|��j�}t|||d��|<|	d
7}	|
d
7}
qT|���_�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�:��
��c�g|]}|��j��qS���decode�charset��.0�x��catalogr�7/usr/lib/python3/dist-packages/babel/messages/mofile.py�
<listcomp>[�zread_mo.<locals>.<listcomp>crrrrrrrr\r)�context)r�getattr�read�len�struct�unpack�LE_MAGIC�BE_MAGIC�IOErrorr�
splitlines�strip�split�lowerrrr�items�mime_headers)�fileobj�headers�filename�buf�buflenr"�magic�version�msgcount�origidx�transidx�ii�i�mlen�moff�mend�tlen�toff�tend�msg�tmsg�lastkey�key�item�value�ctxtrrr�read_mosl
�


�

rEFcs�t��}�fdd�|dd�D�|dd�<|��d}}g}|D]z}|jrad��fdd�|jD��}g}	t|j�D]\}
}|sN|	�|jtt	|
�d��q:|	�|�q:d��fdd�|	D��}n|j�
�j�}|j�
�j�}|jr~d	�|j�
�j�|g�}|�t
|�t
|�t
|�t
|�f�||d7}||d7}q!d
dt
|�}
|
t
|�}g}g}|D]\}}}}||||
g7}||||g7}q�||}|�t�dtd
t
|�d
d
t
|�dd
d
�tt�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 babel._compat 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)�string�fuzzy)r�m)�	use_fuzzyrrr�s��
�zwrite_mo.<locals>.<listcomp>rN�rcrr��encoder)r�msgidrrrr���crrrK)r�msgstrrrrr�rNr���Iiiiiiirr
r7)�list�sort�pluralizable�join�id�	enumeraterF�append�min�intrLrrr �writer!�packr#r�array)r,rrI�messages�ids�strs�offsets�messagerM�msgstrs�idxrFrO�keystart�
valuestart�koffsets�voffsets�o1�l1�o2�l2r)rrIr�write_moksb0"�
��"
���
�rn)F)
�__doc__r^r!�babel.messages.catalogrr�
babel._compatrrr#r$rErnrrrr�<module>s
T

Anon7 - 2022
AnonSec Team