403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.117.196.112
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__/mofile.cpython-36.opt-1.pyc
3

4\0X~�@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 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�N)�Catalog�Message)�
range_type�
array_tobytesl�*l�$<csxt��i}t|dd�}|j�}t|�}tj}|d|dd��d}|tkrj|d|dd��\}}}	}
d	}n4|tkr�|d
|dd��\}}}	}
d}ntdd|���x�t	d|�D�]�}||||	|	d
��\}
}||
}||||
|
d
��\}}||}||k�r$||k�r$|||�}|||�}ntdd|��|
dk�r�d}}xv|j
�D]j}|j�}|�sb�qLd|k�r�|jdd�\}}|j�j
�}}|j�||<n|�rL||d|7<�qLWd|k�r�|jd�\}}nd}d|k�r$|jd�}|jd�}�j�rD�fdd�|D�}�fdd�|D�}n �j�rD|j�j�}|j�j�}t|||d��|<|	d
7}	|
d
7}
q�W|j��_�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�j��qS�)�decode�charset)�.0�x)�catalogr�/usr/lib/python3.6/mofile.py�
<listcomp>[szread_mo.<locals>.<listcomp>csg|]}|j�j��qSr)rr)rr)rrrr\s)�context)r�getattr�read�len�struct�unpack�LE_MAGIC�BE_MAGIC�IOErrorr�
splitlines�strip�split�lowerrrr�itemsZmime_headers)�fileobjZheaders�filenameZbufZbuflenr�magic�versionZmsgcountZorigidxZtransidxZii�iZmlenZmoffZmendZtlenZtoffZtend�msgZtmsgZlastkey�key�item�valueZctxtr)rr�read_mosh







r/Fc
s
t��}|s*dd�|dd�D�|dd�<|j�d}}g}�x|D�]}|jr�dj�fdd�|jD��}g}	x@t|j�D]2\}
}|s�|	j|jtt	|
�d��q||	j|�q|Wdj�fdd�|	D��}n2|jj
�j�}|js�|jj
�j�}n|jj
�j�}|j�rd	j|jj
�j�|g�}|jt
|�t
|�t
|�t
|�f�||d7}||d7}qFWddt
|�}
|
t
|�}g}g}x6|D].\}}}}||||
g7}||||g7}�q�W||}|jtjd
tdt
|�ddt
|�ddd�ttjd|��||�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
    cSsg|]}|js|�qSr)Zfuzzy)r�mrrrr�szwrite_mo.<locals>.<listcomp>rN�rcsg|]}|j�j��qSr)�encoder)r�msgid)rrrr�scsg|]}|j�j��qSr)r2r)r�msgstr)rrrr�sr�r�ZIiiiiiirr
r*�r7r7)�list�sortZpluralizable�join�id�	enumerate�string�append�min�intr2rrr�writer�packrr�array)r&rZ	use_fuzzyZmessagesZidsZstrsZoffsets�messager3Zmsgstrs�idxr=r4ZkeystartZ
valuestartZkoffsetsZvoffsetsZo1�l1Zo2�l2r)rr�write_moksJ0"rH)F)
�__doc__rCrZbabel.messages.catalogrrZ
babel._compatrrrrr/rHrrrr�<module>
sT

Youez - 2016 - github.com/yon3zu
LinuXploit