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__/catalog.cpython-310.pyc
o

V��\(~�@s0dZddlZddlZddlmZddlmZddlmZmZddl	m
Z
ddlmZddl
m
Z
dd	lmZdd
lmZmZddlmZddlmZdd
lmZmZmZddlmZmZmZm Z m!Z!m"Z"gd�Z#e�$dej%�Z&dd�Z'Gdd�de(�Z)Gdd�de*�Z+dZ,er�dd�Z-neZ-Gdd�de(�Z.dS)z�
    babel.messages.catalog
    ~~~~~~~~~~~~~~~~~~~~~~

    Data structures for message catalogs.

    :copyright: (c) 2013-2019 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�N)�parse_header)�OrderedDict)�datetime�time)�get_close_matches)�message_from_string)�copy)�__version__)�Locale�UnknownLocaleError)�format_datetime)�
get_plural)�distinct�LOCALTZ�FixedOffsetTimezone)�string_types�number_types�PY2�cmp�	text_type�
force_text)�Message�Catalog�TranslationErrorz�
    \%
        (?:\(([\w]*)\))?
        (
            [-#0\ +]?(?:\*|[\d]+)?
            (?:\.(?:\*|[\d]+))?
            [hlL]?
        )
        ([diouxXeEfFgGcrs%])
cCs�t�d|�}t�|�d�d�}t�|�}t�|�}|�d�}|dur^|d|dd�}}|dd�|dd�}}	t|d�}
t|�}t|	�}|d	}
|
|7}
|
|
9}
t	|
�}|j
|d
�}|S)Nz+^(?P<datetime>.*?)(?P<tzoffset>[+-]\d{4})?$rz%Y-%m-%d %H:%M�tzoffsetr���1�<��tzinfo)�re�matchr�strptime�group�mktimer�
fromtimestamp�intr�replace)�valuer"�tt�ts�dtr�plus_minus_s�rest�hours_offset_s�
mins_offset_s�
plus_minus�hours_offset�mins_offset�net_mins_offset�r5�8/usr/lib/python3/dist-packages/babel/messages/catalog.py�_parse_datetime_header,s"


r7c@s�eZdZdZ		d!dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d"dd�Zedd��Zedd��Zedd ��ZdS)#rz0Representation of a single message in a catalog.�r5Nc

Cs�||_|s
|jr
d}||_tt|��|_t|�|_|r%|jr%|j�	d�n|j�
d�tt|��|_tt|��|_t
|t�rC|g|_nt|�|_||_|	|_dS)a_Create the message object.

        :param id: the message ID, or a ``(singular, plural)`` tuple for
                   pluralizable messages
        :param string: the translated message string, or a
                       ``(singular, plural)`` tuple for pluralizable messages
        :param locations: a sequence of ``(filename, lineno)`` tuples
        :param flags: a set or sequence of flags
        :param auto_comments: a sequence of automatic comments for the message
        :param user_comments: a sequence of user comments for the message
        :param previous_id: the previous message ID, or a ``(singular, plural)``
                            tuple for pluralizable messages
        :param lineno: the line number on which the msgid line was found in the
                       PO file, if any
        :param context: the message context
        )r8r8z
python-formatN)�id�pluralizable�string�listr�	locations�set�flags�
python_format�add�discard�
auto_comments�
user_comments�
isinstancer�previous_id�lineno�context)
�selfr9r;r=r?rCrDrFrGrHr5r5r6�__init__Os 






zMessage.__init__cCsdt|�j|jt|j�fS)Nz<%s %r (flags: %r)>)�type�__name__r9r<r?�rIr5r5r6�__repr__ts�zMessage.__repr__cCsdd�}t||�||��S)z0Compare Messages, taking into account plural idscSs4t|t�r|jr|jd|jpdfS|j|jpdfS)Nrr8)rErr:r9rH)�objr5r5r6�values_to_comparezsz*Message.__cmp__.<locals>.values_to_compare)r)rI�otherrPr5r5r6�__cmp__xszMessage.__cmp__cCs|�|�dkS�Nr�rR�rIrQr5r5r6�__gt__��zMessage.__gt__cCs|�|�dkSrSrTrUr5r5r6�__lt__�rWzMessage.__lt__cCs|�|�dkSrSrTrUr5r5r6�__ge__�rWzMessage.__ge__cCs|�|�dkSrSrTrUr5r5r6�__le__�rWzMessage.__le__cCs|�|�dkSrSrTrUr5r5r6�__eq__�rWzMessage.__eq__cCs|�|�dkSrSrTrUr5r5r6�__ne__�rWzMessage.__ne__cCs2ttt|j|j|j|j|j|j|j	|j
|jf	��S�N)r�maprr9r;r=r?rCrDrFrGrHrMr5r5r6�clone�s
�z
Message.clonecCsZddlm}g}|D] }z|||�Wq
ty*}z|�|�WYd}~q
d}~ww|S)a�Run various validation checks on the message.  Some validations
        are only performed if the catalog is provided.  This method returns
        a sequence of `TranslationError` objects.

        :rtype: ``iterator``
        :param catalog: A catalog instance that is passed to the checkers
        :see: `Catalog.check` for a way to perform checks for all messages
              in a catalog.
        r)�checkersN)�babel.messages.checkersr`r�append)rI�catalogr`�errors�checker�er5r5r6�check�s
��z
Message.checkcCs
d|jvS)aWhether the translation is fuzzy.

        >>> Message('foo').fuzzy
        False
        >>> msg = Message('foo', 'foo', flags=['fuzzy'])
        >>> msg.fuzzy
        True
        >>> msg
        <Message 'foo' (flags: ['fuzzy'])>

        :type:  `bool`�fuzzy�r?rMr5r5r6rh�s

z
Message.fuzzycCst|jttf�S)z�Whether the message is plurizable.

        >>> Message('foo').pluralizable
        False
        >>> Message(('foo', 'bar')).pluralizable
        True

        :type:  `bool`)rEr9r<�tuplerMr5r5r6r:��
zMessage.pluralizablecCs,|j}t|ttf�s
|g}tdd�|D��S)z�Whether the message contains Python-style parameters.

        >>> Message('foo %(name)s bar').python_format
        True
        >>> Message(('foo %(name)s', 'foo %(name)s')).python_format
        True

        :type:  `bool`css�|]}t�|�VqdSr])�
PYTHON_FORMAT�search)�.0r9r5r5r6�	<genexpr>�s�z(Message.python_format.<locals>.<genexpr>)r9rEr<rj�any)rI�idsr5r5r6r@�s
zMessage.python_format)r8r5r5r5r5r5NNr])rL�
__module__�__qualname__�__doc__rJrNrRrVrXrYrZr[r\r_rg�propertyrhr:r@r5r5r5r6rLs*
�%


rc@seZdZdZdS)rz_Exception thrown by translation checkers when invalid message
    translations are encountered.N)rLrrrsrtr5r5r5r6r�srz�# Translations template for PROJECT.
# Copyright (C) YEAR ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#cCsDt|�d��}i}|��D]\}}|�d�}|�d�}|||<q
|S)N�utf8)r�encode�items�decode)�
header_string�headers�decoded_headers�namer)r5r5r6�
_parse_header�s


r~c
@s4eZdZdZddeddddddddddf
dd�Zdd�Zdd	�Zd
d�Ze	ee�Z
e	e�Zdd
�Zdd�Z
e	ee
dd�Zdd�Zdd�Ze	eedd�Ze	dd��Ze	dd��Ze	dd��Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Z	+	d9d,d-�Zd.d/�Zd:d0d1�Zd:d2d3�Zd;d5d6�Z d:d7d8�Z!dS)<rz$Representation of a message catalog.NTcCs�||_||_||_t�|_|pd|_|pd|_|pd|_|pd|_|
p$d|_		|p*d|_
	|p0d|_|dur<t�
t�}nt|t�rJ|jsJ|jtd	�}||_|	durTd
}	nt|	t�rb|	jsb|	jtd	�}	|	|_|
|_t�|_d|_d|_dS)aDInitialize the catalog object.

        :param locale: the locale identifier or `Locale` object, or `None`
                       if the catalog is not bound to a locale (which basically
                       means it's a template)
        :param domain: the message domain
        :param header_comment: the header comment as string, or `None` for the
                               default header
        :param project: the project's name
        :param version: the project's version
        :param copyright_holder: the copyright holder of the catalog
        :param msgid_bugs_address: the email address or URL to submit bug
                                   reports to
        :param creation_date: the date the catalog was created
        :param revision_date: the date the catalog was revised
        :param last_translator: the name and email of the last translator
        :param language_team: the name and email of the language team
        :param charset: the encoding to use in the output (defaults to utf-8)
        :param fuzzy: the fuzzy bit on the catalog header
        �PROJECT�VERSION�ORGANIZATIONz
EMAIL@ADDRESSzFULL NAME <EMAIL@ADDRESS>zLANGUAGE <LL@li.org>zutf-8NrzYEAR-MO-DA HO:MI+ZONE)�domain�locale�_header_commentr�	_messages�project�version�copyright_holder�msgid_bugs_address�last_translator�
language_team�charsetr�nowrrEr r(�
creation_date�
revision_daterh�obsolete�_num_plurals�_plural_expr)rIr�r��header_commentr�r�r�r�r�r�r�r�r�rhr5r5r6rJ�s6







zCatalog.__init__cCs�|durd|_d|_dSt|t�rt|�|_||_dSt|t�r<t|�|_z	t�|�|_WdSty;d|_YdSwtd|��)NzF`locale` must be a Locale, a locale identifier string, or None; got %r)	�_locale_identifier�_localerEr
rr�parser�	TypeError�rIr�r5r5r6�_set_locale/s$



��zCatalog._set_localecC�|jSr])r�rMr5r5r6�_get_localeD�zCatalog._get_localecCr�r])r�rMr5r5r6�_get_locale_identifierGr�zCatalog._get_locale_identifiercCs�|j}t�t��d�}t|jd�r|j�d�}|�d|j��d|j	��d|��d|j
�}|jr3|jjn|j
}|r@|�dd|�}|S)	Nz%Y�strftimerr��YEARr�zTranslations templatez%s translations)r�rr�rr��hasattrr�r(r�r�r�r��english_name�locale_identifier)rI�comment�year�locale_namer5r5r6�_get_header_commentMs

�zCatalog._get_header_commentcCs
||_dSr])r�)rIr;r5r5r6�_set_header_comment[s
zCatalog._set_header_commenta�    The header comment for the catalog.

    >>> catalog = Catalog(project='Foobar', version='1.0',
    ...                   copyright_holder='Foo Company')
    >>> print(catalog.header_comment) #doctest: +ELLIPSIS
    # Translations template for Foobar.
    # Copyright (C) ... Foo Company
    # This file is distributed under the same license as the Foobar project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, ....
    #

    The header can also be set from a string. Any known upper-case variables
    will be replaced when the header is retrieved again:

    >>> catalog = Catalog(project='Foobar', version='1.0',
    ...                   copyright_holder='Foo Company')
    >>> catalog.header_comment = '''\
    ... # The POT for my really cool PROJECT project.
    ... # Copyright (C) 1990-2003 ORGANIZATION
    ... # This file is distributed under the same license as the PROJECT
    ... # project.
    ... #'''
    >>> print(catalog.header_comment)
    # The POT for my really cool Foobar project.
    # Copyright (C) 1990-2003 Foo Company
    # This file is distributed under the same license as the Foobar
    # project.
    #

    :type: `unicode`
    )�doccCsJg}|�dd|j|jff�|�d|jf�|�dt|jddd�f�t|jtt	ft
�r<|�dt|jddd�f�n|�d|jf�|�d	|jf�|jrY|�d
t
|j�f�|jrqd|jvrq|�d|j�dt
|j��f�n|�d|jf�|jdur�|�d
|jf�|�d�|�dd|jf�|�d�|�ddtf�|S)NzProject-Id-Versionz%s %szReport-Msgid-Bugs-TozPOT-Creation-Datezyyyy-MM-dd HH:mmZ�en)r�zPO-Revision-DatezLast-Translator�Language�LANGUAGEz
Language-TeamzPlural-Forms)zMIME-Versionz1.0zContent-Typeztext/plain; charset=%s)zContent-Transfer-Encoding�8bitzGenerated-Byz	Babel %s
)rbr�r�r�rr�rEr�r�time_rr�r��strr�r(r��plural_formsr�r�)rIr{r5r5r6�_get_mime_headerssH�������

�
zCatalog._get_mime_headerscCsH|D]�\}}t|��|jd�}t||jd�}|dkr/|�d�}d�|dd��|_|d|_q|dkr7||_q|dkr?||_q|dkrO|�	dd	�}|�
|�q|d
krW||_q|dkrmt|�\}}d|vrl|d��|_q|d
kr�td|�\}}t
|�dd��|_|�dd�|_q|dkr�t|�|_q|dkr�d|vr�t|�|_qdS)N)�encodingzproject-id-version� ���zreport-msgid-bugs-tozlast-translator�language�-�_z
language-teamzcontent-typer�zplural-formsz ;�npluralsr�plural�(n != 1)zpot-creation-datezpo-revision-dater�)r�lowerr��split�joinr�r�r�r�r(r�r�rr'�getr�r�r7r�r�)rIr{r}r)�parts�mimetype�paramsr�r5r5r6�_set_mime_headers�s@
�
��zCatalog._set_mime_headersa�    The MIME headers of the catalog, used for the special ``msgid ""`` entry.

    The behavior of this property changes slightly depending on whether a locale
    is set or not, the latter indicating that the catalog is actually a template
    for actual translations.

    Here's an example of the output for such a catalog template:

    >>> from babel.dates import UTC
    >>> created = datetime(1990, 4, 1, 15, 30, tzinfo=UTC)
    >>> catalog = Catalog(project='Foobar', version='1.0',
    ...                   creation_date=created)
    >>> for name, value in catalog.mime_headers:
    ...     print('%s: %s' % (name, value))
    Project-Id-Version: Foobar 1.0
    Report-Msgid-Bugs-To: EMAIL@ADDRESS
    POT-Creation-Date: 1990-04-01 15:30+0000
    PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE
    Last-Translator: FULL NAME <EMAIL@ADDRESS>
    Language-Team: LANGUAGE <LL@li.org>
    MIME-Version: 1.0
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit
    Generated-By: Babel ...

    And here's an example of the output when the locale is set:

    >>> revised = datetime(1990, 8, 3, 12, 0, tzinfo=UTC)
    >>> catalog = Catalog(locale='de_DE', project='Foobar', version='1.0',
    ...                   creation_date=created, revision_date=revised,
    ...                   last_translator='John Doe <jd@example.com>',
    ...                   language_team='de_DE <de@example.com>')
    >>> for name, value in catalog.mime_headers:
    ...     print('%s: %s' % (name, value))
    Project-Id-Version: Foobar 1.0
    Report-Msgid-Bugs-To: EMAIL@ADDRESS
    POT-Creation-Date: 1990-04-01 15:30+0000
    PO-Revision-Date: 1990-08-03 12:00+0000
    Last-Translator: John Doe <jd@example.com>
    Language: de_DE
    Language-Team: de_DE <de@example.com>
    Plural-Forms: nplurals=2; plural=(n != 1)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit
    Generated-By: Babel ...

    :type: `list`
    cC�.|jdurd}|jrt|j�d}||_|jS)z�The number of plurals used by the catalog or locale.

        >>> Catalog(locale='en').num_plurals
        2
        >>> Catalog(locale='ga').num_plurals
        5

        :type: `int`Nrr)r�r�r
)rI�numr5r5r6�num_plurals�s

zCatalog.num_pluralscCr�)a`The plural expression used by the catalog or locale.

        >>> Catalog(locale='en').plural_expr
        '(n != 1)'
        >>> Catalog(locale='ga').plural_expr
        '(n==1 ? 0 : n==2 ? 1 : n>=3 && n<=6 ? 2 : n>=7 && n<=10 ? 3 : 4)'
        >>> Catalog(locale='ding').plural_expr  # unknown locale
        '(n != 1)'

        :type: `string_types`Nr�r)r�r�r
)rI�exprr5r5r6�plural_exprs
zCatalog.plural_exprcCsd|j|jfS)z�Return the plural forms declaration for the locale.

        >>> Catalog(locale='en').plural_forms
        'nplurals=2; plural=(n != 1)'
        >>> Catalog(locale='pt_BR').plural_forms
        'nplurals=2; plural=(n > 1)'

        :type: `str`znplurals=%s; plural=%s)r�r�rMr5r5r6r�rkzCatalog.plural_formscCs|�|�|jvS)z?Return whether the catalog has a message with the specified ID.��_key_forr��rIr9r5r5r6�__contains__"szCatalog.__contains__cCs
t|j�S)zeThe number of messages in the catalog.

        This does not include the special ``msgid ""`` entry.)�lenr�rMr5r5r6�__len__&s
zCatalog.__len__ccsp�g}|jD]
\}}|�d||f�qt�}|jr|dhO}tdd�|�|d�V|jD]}|j|Vq-dS)z�Iterates through all the entries in the catalog, in the order they
        were added, yielding a `Message` object for every entry.

        :rtype: ``iterator``z%s: %srhr8�
riN)�mime_headersrbr>rhrr�r�)rI�bufr}r)r?�keyr5r5r6�__iter__,s�

�zCatalog.__iter__cCs*d}|jr
d|j}dt|�j|j|fS)Nr8z %sz	<%s %r%s>)r�rKrLr�r�r5r5r6rN;s
zCatalog.__repr__cCs|�|�dS)z)Delete the message with the specified ID.N)�deleter�r5r5r6�__delitem__AszCatalog.__delitem__cCs
|�|�S)zUReturn the message with the specified ID.

        :param id: the message ID
        )r�r�r5r5r6�__getitem__Es
zCatalog.__getitem__cCs t|t�s	Jd��|�||j�}|j�|�}|rS|jr&|js&|j|_|j|_t	t
|j|j��|_t	t
|j|j��|_t	t
|j
|j
��|_
|j|jO_|}dS|dkrqt|j���|_d�dd�|j
D��|_|j|_dSt|t	tf�r�t|jt	tf�s�Jdt|j���||j|<dS)a�Add or update the message with the specified ID.

        >>> catalog = Catalog()
        >>> catalog[u'foo'] = Message(u'foo')
        >>> catalog[u'foo']
        <Message u'foo' (flags: [])>

        If a message with that ID is already in the catalog, it is updated
        to include the locations and flags of the new message.

        >>> catalog = Catalog()
        >>> catalog[u'foo'] = Message(u'foo', locations=[('main.py', 1)])
        >>> catalog[u'foo'].locations
        [('main.py', 1)]
        >>> catalog[u'foo'] = Message(u'foo', locations=[('utils.py', 5)])
        >>> catalog[u'foo'].locations
        [('main.py', 1), ('utils.py', 5)]

        :param id: the message ID
        :param message: the `Message` object
        zexpected a Message objectr8r�cSsg|]}d|���qS)z# %s)�rstrip)rn�cr5r5r6�
<listcomp>usz'Catalog.__setitem__.<locals>.<listcomp>zExpected sequence but got %sN)rErr�rHr�r�r:r9r;r<rr=rCrDr?r~rxr�r�r�rhrjrK)rIr9�messager��currentr5r5r6�__setitem__Ls:
�
�
�

��zCatalog.__setitem__r5c
Cs*t||t|�||||||	d�	}
|
||<|
S)atAdd or update the message with the specified ID.

        >>> catalog = Catalog()
        >>> catalog.add(u'foo')
        <Message ...>
        >>> catalog[u'foo']
        <Message u'foo' (flags: [])>

        This method simply constructs a `Message` object with the given
        arguments and invokes `__setitem__` with that object.

        :param id: the message ID, or a ``(singular, plural)`` tuple for
                   pluralizable messages
        :param string: the translated message string, or a
                       ``(singular, plural)`` tuple for pluralizable messages
        :param locations: a sequence of ``(filename, lineno)`` tuples
        :param flags: a set or sequence of flags
        :param auto_comments: a sequence of automatic comments
        :param user_comments: a sequence of user comments
        :param previous_id: the previous message ID, or a ``(singular, plural)``
                            tuple for pluralizable messages
        :param lineno: the line number on which the msgid line was found in the
                       PO file, if any
        :param context: the message context
        )rGrH)rr<)rIr9r;r=r?rCrDrFrGrHr�r5r5r6rA~s�zCatalog.addccs0�|j��D]}|j|d�}|r||fVqdS)aBRun various validation checks on the translations in the catalog.

        For every message which fails validation, this method yield a
        ``(message, errors)`` tuple, where ``message`` is the `Message` object
        and ``errors`` is a sequence of `TranslationError` objects.

        :rtype: ``iterator``
        )rcN)r��valuesrg)rIr�rdr5r5r6rg�s�	
��z
Catalog.checkcCs|j�|�||��S)z�Return the message with the specified ID and context.

        :param id: the message ID
        :param context: the message context, or ``None`` for no context
        )r�r�r�)rIr9rHr5r5r6r��szCatalog.getcCs&|�||�}||jvr|j|=dSdS)z�Delete the message with the specified ID and context.

        :param id: the message ID
        :param context: the message context, or ``None`` for no context
        Nr��rIr9rHr�r5r5r6r��s
�zCatalog.deleteFcs6�j�����t��_g}|st��fdd��D��}t�������fdd�}|D]R}|jr|��|j|j�}|�vrB||||�q*|durwt|t	�rP|d}	n|}	t
|	����|�
�d�}
|
rw|
d}||}|durp||f}||||�q*|�|j<q*�D]}
|s�|
�vr��|
�j|
<q|r�|j�_|j�_dS)	a�Update the catalog based on the given template catalog.

        >>> from babel.messages import Catalog
        >>> template = Catalog()
        >>> template.add('green', locations=[('main.py', 99)])
        <Message ...>
        >>> template.add('blue', locations=[('main.py', 100)])
        <Message ...>
        >>> template.add(('salad', 'salads'), locations=[('util.py', 42)])
        <Message ...>
        >>> catalog = Catalog(locale='de_DE')
        >>> catalog.add('blue', u'blau', locations=[('main.py', 98)])
        <Message ...>
        >>> catalog.add('head', u'Kopf', locations=[('util.py', 33)])
        <Message ...>
        >>> catalog.add(('salad', 'salads'), (u'Salat', u'Salate'),
        ...             locations=[('util.py', 38)])
        <Message ...>

        >>> catalog.update(template)
        >>> len(catalog)
        3

        >>> msg1 = catalog['green']
        >>> msg1.string
        >>> msg1.locations
        [('main.py', 99)]

        >>> msg2 = catalog['blue']
        >>> msg2.string
        u'blau'
        >>> msg2.locations
        [('main.py', 100)]

        >>> msg3 = catalog['salad']
        >>> msg3.string
        (u'Salat', u'Salate')
        >>> msg3.locations
        [('util.py', 42)]

        Messages that are in the catalog but not in the template are removed
        from the main collection, but can still be accessed via the `obsolete`
        member:

        >>> 'head' in catalog
        False
        >>> list(catalog.obsolete.values())
        [<Message 'head' (flags: [])>]

        :param template: the reference catalog, usually read from a POT file
        :param no_fuzzy_matching: whether to use fuzzy matching of message IDs
        cs.g|]}|r�|jr��|��|jf�qSr5)r;r�rH)rn�msgid)�messagesrIr5r6r��s���z"Catalog.update.<locals>.<listcomp>csD|��}d}||kr)d}��|���|�}t|jt�r"|jg|_n
t|j�|_n��|d�}|j	|_	�r=tt
|j��|_t|jttf�ryt|j	ttf�sad}t|j	gdgt
|j�d�|_	n(t
|j	��jkrxd}t|j	dt
|j	���|_	nt|j	ttf�r�d}|j	d|_	|j|jO_|r�|jdhO_|�|j<dS)NFTr8rrrh)r_rAr�rEr9rrFr<�popr;rrDrjr�r�r?)r��oldkey�newkeyrh�oldmsg��
fuzzy_matches�keep_user_commentsr��	remainingrIr5r6�_merges<

��zCatalog.update.<locals>._mergeFrrN)r�rr�dictr>r9r�rHrErjrr��strip�keysr�r�r�)rI�template�no_fuzzy_matching�update_header_commentr��fuzzy_candidatesr�r�r��matchkey�matchesr��newctxtr�r5r�r6�update�sL5�#

�
��zCatalog.updatecCs.|}t|ttf�r
|d}|dur||f}|S)z�The key for a message is just the singular ID even for pluralizable
        messages, but is a ``(msgid, msgctxt)`` tuple for context-specific
        messages.
        rN)rEr<rjr�r5r5r6r�IszCatalog._key_for)Nr5r5r5r5r5NNr])FFT)"rLrrrsrt�DEFAULT_HEADERrJr�r�r�rur�r�r�r�r�r�r�r�r�r�r�r�r�r�rNr�r�r�rArgr�r�r�r�r5r5r5r6r�sR
�:
!  3


2
�!



r)/rtr!r�cgir�collectionsrrr��difflibr�emailrr�babelr	r��
babel.corer
r�babel.datesr�babel.messages.pluralsr
�
babel.utilrrr�
babel._compatrrrrrr�__all__�compile�VERBOSErlr7�objectr�	Exceptionrr�r~rr5r5r5r6�<module>s8
 	� 


Anon7 - 2022
AnonSec Team