관리-도구
편집 파일: catalog.cpython-311.pyc
� ���I����z�������������������������U�d�Z�ddlmZ�ddlZddlZddlmZ�ddlmZm Z �ddl m Z �ddlmZ�ddl mZ�dd lmZ�dd lmZ�ddlmZ�ddlmZmZ�dd lmZ�ddlmZ�ddlmZmZm Z m!Z!�er!ddl"m#Z#�e$e%e$df���������z��e&e$���������z��Z'de(d<���g�d�Z)d'd�Z*�ej+��������dej,��������������������Z-d(d�Z.�G�d��d������������Z/�G�d ��d!e0������������Z1d"Z2d)d$�Z3�G�d%��d&������������Z4dS�)*z� babel.messages.catalog ~~~~~~~~~~~~~~~~~~~~~~ Data structures for message catalogs. :copyright: (c) 2013-2023 by the Babel Team. :license: BSD, see LICENSE for more details. �����)�annotationsN)�OrderedDict)�Iterable�Iterator)�copy)�SequenceMatcher)�message_from_string)�nlargest)� TYPE_CHECKING)�__version__)�Locale�UnknownLocaleError)�format_datetime)� get_plural)�LOCALTZ�FixedOffsetTimezone�_cmp�distinct)� TypeAlias.r���� _MessageID)�Message�Catalog�TranslationError�����333333�?c���������������������|dk����st����������d|���������������d|cxk����rdk����sn�t����������d|���������������g�}t����������d�������������}|���������������������|��������������|D�]�}|���������������������|�������������|�����������������������������������|k����rY|�����������������������������������|k����rA|�����������������������������������|k����r)|���������������������|�����������������������������������|f���������������t����������||������������}d��|D���������������S�) z�A modified version of ``difflib.get_close_matches``. It just passes ``autojunk=False`` to the ``SequenceMatcher``, to work around https://github.com/python/cpython/issues/90825. r���zn must be > 0: g��������g�������?zcutoff must be in [0.0, 1.0]: F)�autojunkc����������������������g�|�]\��}}|��S���r���)�.0�score�xs��� �v/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/babel/messages/catalog.py� <listcomp>z%get_close_matches.<locals>.<listcomp>:���s������%�%�%�(�%��A�%�%�%�����) � ValueErrorr����set_seq2�set_seq1�real_quick_ratio�quick_ratio�ratio�appendr ���)�word� possibilities�n�cutoff�result�sr"���s��� r#����get_close_matchesr3���#���s ������ �q�5�5��0�1�0�0�1�1�1��&�����C������D�&�D�D�E�E�E� �F���'�'�'�A��J�J�t���� ��*��*�� � � �1� � � ������6�)�)��=�=�?�?�f�$�$��7�7�9�9�����M�M�1�7�7�9�9�a�.�)�)�)����a�� � �F�%�%�f�%�%�%�%r%���z� \% (?:\(([\w]*)\))? ( [-#0\ +]?(?:\*|[\d]+)? (?:\.(?:\*|[\d]+))? [hlL]? ) ([diouxXeEfFgGcrs%]) �value�str�return�datetime.datetimec����������������������t����������j��������d|�������������}t����������j�����������������������������|���������������������d������������d������������}|���������������������d������������}|��|d���������|dd�����������}}|d�d����������|dd�����������}}t����������|��d�������������}t����������|������������} t����������|������������} | d z��}|| z ��}||z��}t ����������|������������}|���������������������|� ������������}|S�)Nz+^(?P<datetime>.*?)(?P<tzoffset>[+-]\d{4})?$�datetimez%Y-%m-%d %H:%M�tzoffsetr������������1�<�����tzinfo)�re�matchr9����strptime�group�intr����replace)r4���rB����dtr:����plus_minus_s�rest�hours_offset_s� mins_offset_s� plus_minus�hours_offset�mins_offset�net_mins_offsets��� r#����_parse_datetime_headerrP���I���s��������H�C�U�K�K�E� � � #� #�E�K�K� �$;�$;�=M� N� N�B���{�{�:�&�&�H���%�a�[�(�1�2�2�,�d��(,�R�a�R��$�q�r�r�(� ����L�+�+�+�,�,� ��>�*�*���-�(�(���'��+���;�&���:�%���'��7�7����Z�Z�x�Z� (� (�� �Ir%���c�������������������������e�Zd�ZdZ � � � � � � � �d-d.d�Zd/d�Zd0d�Zd1d�Zd1d�Zd1d �Z d1d!�Z d1d"�Zd1d#�Zd2d$�Z d3d%�Zd4d5d)�Zed6d*���������������Zed6d+���������������Zed6d,���������������ZdS�)7r���z0Representation of a single message in a catalog.��r���N�idr����string�_MessageID | None� locations�Iterable[tuple[str, int]]�flags� Iterable[str]� auto_comments� user_comments�previous_id�lineno� int | None�context� str | Noner6����Nonec �����������������"����||�_���������|s |�j��������rd}||�_��������t����������t ����������|������������������������|�_��������t ����������|������������|�_��������|r"|�j��������r|�j��������� ��������������������d�������������n|�j��������� ��������������������d�������������t����������t ����������|������������������������|�_��������t����������t ����������|������������������������|�_��������t����������|t����������������������r |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 )rR���rR���z python-formatN)rS����pluralizablerT����listr���rV����setrX���� python_format�add�discardrZ���r[���� isinstancer5���r\���r]���r_���) �selfrS���rT���rV���rX���rZ���r[���r\���r]���r_���s ��� r#����__init__zMessage.__init__j���s�������8������ �$�+�� ��F�����h�y�1�1�2�2�����Z�Z�� � �� 0�$�$�� 0��J�N�N�?�+�+�+�+��J����/�/�/�!�(�=�"9�"9�:�:���!�(�=�"9�"9�:�:����k�3�'�'�� 1� +�}�D���#�K�0�0�D���������r%���r5���c�����������������l�����dt����������|�������������j����������d|�j���������dt����������|�j���������������������d�S�)N�<� z (flags: z)>)�type�__name__rS���rd���rX����rj���s��� r#����__repr__zMessage.__repr__����s8������S�4��:�:�&�S�S���S�S�T�$�*�=M�=M�S�S�S�Sr%����other�objectrE���c�����������������L�����d��}t�����������||��������������||������������������������S�)z0Compare Messages, taking into account plural idsc����������������������t����������|�t����������������������r|�j��������r|�j��������d���������|�j��������pdfS�|�j��������|�j��������pdfS�)Nr���rR���)ri���r���rc���rS���r_���)�objs��� r#����values_to_comparez*Message.__cmp__.<locals>.values_to_compare����sJ�������#�w�'�'�� 4�C�,<�� 4��v�a�y�#�+�"3��3�3��6�3�;�,�"�,�,r%���)r���)rj���rs���rx���s��� r#����__cmp__zMessage.__cmp__����s;������ -�� -�� -���%�%�d�+�+�->�->�u�-E�-E�F�F�Fr%����boolc�����������������4�����|�����������������������|������������dk����S��Nr����ry����rj���rs���s��� r#����__gt__zMessage.__gt__������������|�|�E�"�"�Q�&�&r%���c�����������������4�����|�����������������������|������������dk�����S�r|���r}���r~���s��� r#����__lt__zMessage.__lt__����r����r%���c�����������������4�����|�����������������������|������������dk����S�r|���r}���r~���s��� r#����__ge__zMessage.__ge__������������|�|�E�"�"�a�'�'r%���c�����������������4�����|�����������������������|������������dk����S�r|���r}���r~���s��� r#����__le__zMessage.__le__����r����r%���c�����������������4�����|�����������������������|������������dk����S�r|���r}���r~���s��� r#����__eq__zMessage.__eq__����r����r%���c�����������������4�����|�����������������������|������������dk����S�r|���r}���r~���s��� r#����__ne__zMessage.__ne__����r����r%���c�����������������P�����t����������|t����������������������sJ��|�j��������|j��������k����S�)z[Checks whether messages are identical, taking into account all properties. )ri���r����__dict__r~���s��� r#����is_identicalzMessage.is_identical����s)��������%��)�)�)�)�)��}���.�.r%���c����������������������t����������t����������t����������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j ��������|�j ��������|�j��������f ��������������S��N)r����mapr���rS���rT���rV���rX���rZ���r[���r\���r]���r_���rq���s��� r#����clonez Message.clone����sN��������D�4�7�D�K���#'�:�t�/A�#'�#5�t�7G�#'�;���#>��?��?��@�� @r%����catalog�Catalog | None�list[TranslationError]c����������������������ddl�m}�g�}|D�];} ��|||���������������#�t����������$�r}|���������������������|�������������Y�d}~�4d}~ww�xY�w|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���r,���)rj���r����r�����errors�checker�es��� r#����checkz Message.check����s�������� 5�4�4�4�4�4�)+���� !�� !�G� !�����&�&�&�&��#�� !�� !�� !�� � �a� � � � � � � � ����� !����� s����� A�?�Ac����������������������d|�j���������v�S�)a���Whether 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�rX���rq���s��� r#���r����z Message.fuzzy����s��������$�*�$�$r%���c�����������������D�����t����������|�j��������t����������t����������f������������S�)z�Whether the message is plurizable. >>> Message('foo').pluralizable False >>> Message(('foo', 'bar')).pluralizable True :type: `bool`)ri���rS���rd����tuplerq���s��� r#���rc���zMessage.pluralizable����s��������$�'�D�%�=�1�1�1r%���c����������������������|�j���������}t����������|t����������t����������f������������s|g}t ����������d��|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`c��������������3���J���K����|�]}t��������������������������������|������������V����d�S�r����)� PYTHON_FORMAT�search)r ���rS���s��� r#���� <genexpr>z(Message.python_format.<locals>.<genexpr>����s0����������:�:��=�'�'��+�+�:�:�:�:�:�:r%���)rS���ri���rd���r�����any)rj����idss��� r#���rf���zMessage.python_format����sE��������g���#��e�}�-�-�� ��%�C��:�:�c�:�:�:�:�:�:r%���)rR���r���r���r���r���r���NN)rS���r���rT���rU���rV���rW���rX���rY���rZ���rY���r[���rY���r\���r���r]���r^���r_���r`���r6���ra����r6���r5���)rs���rt���r6���rE���)rs���rt���r6���rz���)rs���r���r6���rz���)r6���r���r����)r����r����r6���r����)r6���rz���)rp���� __module__�__qualname__�__doc__rk���rr���ry���r���r����r����r����r����r����r����r����r�����propertyr����rc���rf���r���r%���r#���r���r���g���s��������������:�:� �%'�/1�!�')�')�"$�!�"�-��-��-��-��-�^T��T��T��T�G��G��G��G�'��'��'��'�'��'��'��'�(��(��(��(�(��(��(��(�(��(��(��(�(��(��(��(�/��/��/��/�@��@��@��@����������&��%��%��%���X�%��� 2�� 2�� 2���X� 2���;��;��;���X�;��;��;r%���r���c������������������������e�Zd�ZdZdS�)r���z_Exception thrown by translation checkers when invalid message translations are encountered.N)rp���r����r����r����r���r%���r#���r���r�����s��������������%��%��%��%r%���r���z�# 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. #�dict[str, str]c�����������������n�����ddl�m}��|��������������}|�|d<���t����������|�����������������������������������������������S�)Nr���)r����content-type)� email.messager����dict� get_params)r4���r����ms��� r#����parse_separated_headerr������s?������%�%�%�%�%�%��� � �A��A�n����������r%���c������������ �����������e�Zd�ZdZddeddddddddddf d]d�Zd^d�Zd_d�Zd`d�Z�e ee������������Z �e e������������Zdad�Zdbd!�Z �e ee d"�#������������Zdcd%�Zddded,�Zdfd/�Z�e eed0�#������������Ze dgd2���������������Ze dad3���������������Ze dad4���������������Zdhd7�Zdgd8�Zdid:�Zdad;�Zdjd<�Zdkd>�Zdld@�Z � � � � � � � �dmdndM�ZdodO�ZdpdqdQ�ZdpdrdR�Z � � �dsdtdX�Z!dpdudZ�Z"dvd\�Z#dS�)wr���z$Representation of a message catalog.NT�locale�str | Locale | None�domainr`����header_comment�project�version�copyright_holder�msgid_bugs_address� creation_date�datetime.datetime | str | None� revision_date�6datetime.datetime | datetime.time | float | str | None�last_translator� language_team�charsetr����rz���r6���ra���c���������������������||�_���������||�_��������||�_��������t������������������������|�_��������|pd|�_��������|pd|�_��������|pd|�_��������|pd|�_��������| pd|�_ �������� �|pd|�_ �������� �|pd|�_��������|�%t����������j��������� ��������������������t����������������������}n<t����������|t����������j��������������������r"|j��������s|���������������������t����������� ������������}||�_��������| �d } n<t����������| t����������j��������������������r"| j��������s| ���������������������t����������� ������������} | |�_��������| |�_��������t������������������������|�_��������d|�_��������d|�_��������dS�)aD��Initialize 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>�utf-8Nr?���zYEAR-MO-DA HO:MI+ZONE)r����r�����_header_commentr���� _messagesr����r����r����r����r����r����r����r9����nowr���ri���r@���rF���r����r����r�����obsolete�_num_plurals�_plural_expr)rj���r����r����r����r����r����r����r����r����r����r����r����r����r����s��� r#���rk���zCatalog.__init__��s[�����H�������-���FQ�m�m����+�)����+�)��� 0� B�N���"4�"G����.�M�2M���<�*�D�.D���:��)�'���� �$�-�1�1�'�:�:�M�M� � �x�'8� 9� 9�� B�-�BV�� B�)�1�1��1�A�A�M�*���� �3�M�M� � �x�'8� 9� 9�� B�-�BV�� B�)�1�1��1�A�A�M�*����� ��FQ�]�]�� � ��� ����r%����Locale | str | Nonec�����������������h����|�d�|�_���������d�|�_��������d�S�t����������|t����������������������rt ����������|������������|�_���������||�_��������d�S�t����������|t����������������������rHt ����������|������������|�_��������� �t����������j��������|������������|�_��������n#�t����������$�r �d�|�_��������Y�nw�xY�wd�S�t����������d|���������������)NzD`locale` must be a Locale, a locale identifier string, or None; got )�_locale_identifier�_localeri���r ���r5����parser���� TypeError�rj���r����s��� r#����_set_localezCatalog._set_locale_��s��������>�&*�D�#��D�L��F��f�f�%�%�� �&)�&�k�k�D�#�!�D�L��F��f�c�"�"�� �&)�&�k�k�D�#� $�%�|�F�3�3�����%�� $�� $�� $�#����� $�����F��i�_e�i�i�j�j�js����/B �� B�B� Locale | Nonec����������������������|�j���������S�r����)r����rq���s��� r#����_get_localezCatalog._get_localet��s �������|�r%���c����������������������|�j���������S�r����)r����rq���s��� r#����_get_locale_identifierzCatalog._get_locale_identifierw��s�������&�&r%���r5���c���������������������|�j���������}t����������j�����������������������������t�������������������������������������������d������������}t����������|�j��������d������������r|�j�����������������������������d������������}|���������������������d|�j�����������������������������������������d|�j �����������������������������������������d|���������������������������������d|�j ��������������������}|�j��������r|�j��������j��������n|�j ��������}|r|���������������������d|��d�������������}|S�) Nz%Y�strftimer����r�����YEARr����zTranslations templatez translations)r����r9���r����r���r�����hasattrr����rF���r����r����r����r�����english_name�locale_identifier)rj����comment�year�locale_names��� r#����_get_header_commentzCatalog._get_header_comment}��s��������&��� �$�$�W�-�-�6�6�t�<�<���4�%�z�2�2�� 5��%�.�.�t�4�4�D��/�/�)�T�\�:�:�!�'�)�T�\�:�:�!�'�&�$�/�/�!�'�.�$�2G�H�H�� ��48�;�Z�t�{�/�/�D�DZ���� ^��o�o�&=�+�?\�?\�?\�]�]�G��r%���rT���c����������������������||�_���������d�S�r����)r����)rj���rT���s��� r#����_set_header_commentzCatalog._set_header_comment���s������%����r%���a��� 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` )�doc�list[tuple[str, str]]c����������� ������t����g�}|����������������������d|�j����������d|�j�����������f�������������|����������������������d|�j��������f�������������|����������������������dt ����������|�j��������dd�������������f�������������t ����������|�j��������t����������j��������t����������j ��������t����������t����������f������������r-|����������������������dt ����������|�j��������dd�������������f�������������n|����������������������d|�j��������f�������������|����������������������d |�j��������f�������������|�j ��������r)|����������������������d t����������|�j ��������������������f�������������|�j ��������rLd|�j��������v�rC|����������������������d|�j�����������������������������dt����������|�j ��������������������������������f�������������n|����������������������d|�j��������f�������������|�j���������|����������������������d |�j��������f�������������|����������������������d�������������|����������������������dd|�j�����������f�������������|����������������������d�������������|����������������������ddt(������������d�f�������������|S�)NzProject-Id-Versionrn���zReport-Msgid-Bugs-TozPOT-Creation-Datezyyyy-MM-dd HH:mmZ�en)r����zPO-Revision-DatezLast-Translator�Language�LANGUAGEz Language-TeamzPlural-Forms)zMIME-Versionz1.0zContent-Typeztext/plain; charset=)zContent-Transfer-Encoding�8bitzGenerated-ByzBabel � )r,���r����r����r����r���r����ri���r����r9����timerE����floatr����r����r5���r����rF���r�����plural_formsr����r����)rj����headerss��� r#����_get_mime_headerszCatalog._get_mime_headers���sq�����)+�����,���.N�.N���.N�.N�O�P�P�P����.��0G�H�I�I�I����+�'��(:�<O�/3�5��5��5�6�� 7�� 7�� 7���d�(�8�+<�h�m�S�RW�*X�Y�Y�� E��N�N�.�+�D�,>�,?��N��N��N�O�� P�� P�� P�� P�� �N�N�.��0B�C�D�D�D����)�4�+?�@�A�A�A��!�� F��N�N�J��D�,B�(C�(C�D�E�E�E��!�� B�z�T�5G�'G�'G��N�N�O� �.�6�6�z�7:�4�;Q�7R�7R�T��T�U�� V�� V�� V�� V�� �N�N�O�T�-?�@�A�A�A��;�"��N�N�N�D�,=�>�?�?�?����.�/�/�/�����(M�t�|�(M�(M�N�O�O�O����<�=�=�=�����(<��(<�(<�(<�=�>�>�>��r%���r�����strictr2����str | bytes�encodingr����c����������������������t����������|t����������������������r|S�t����������|t����������������������r|���������������������||������������S�t����������|������������S�r����)ri���r5����bytes�decode)rj���r2���r����r����s��� r#����_force_textzCatalog._force_text���sJ�������a����� ��H��a����� .��8�8�H�f�-�-�-��1�v�v� r%���r�����Iterable[tuple[str, str]]c���������������������|D��]�\��}}|�����������������������|�����������������������������������|�j���������������������}|�����������������������||�j���������������������}|dk����rE|���������������������d������������}d���������������������|d�d����������������������|�_��������|d���������|�_����������|dk����r||�_����������|dk����r||�_����������|dk����r,|� ��������������������dd ������������}|�� ��������������������|���������������|d k����r||�_����������|dk����r4t����������|������������}d|v�r|d��������������������������������������������|�_����������1|d k����rWt����������d|���������������}t����������|���������������������dd������������������������|�_��������|���������������������dd������������|�_�����������|dk����rt#����������|������������|�_�����������|dk����rd|vrt#����������|������������|�_�����������d�S�)N)r����zproject-id-versionrn������zreport-msgid-bugs-tozlast-translator�language�-�_z language-teamr����r����zplural-formsz ;�npluralsr<����plural�(n != 1)zpot-creation-datezpo-revision-dater����)r�����lowerr�����split�joinr����r����r����r����rF���r����r����r����rE����getr����r����rP���r����r����)rj���r�����namer4����parts�paramss��� r#����_set_mime_headerszCatalog._set_mime_headers���s������"�� G�� G�K�D�%��#�#�D�J�J�L�L�4�<�#�H�H�D��$�$�U�T�\�$�B�B�E��+�+�+����C�(�(��"�x�x��c�r�c� �3�3���$�R�y�����/�/�/�*/��'�'��*�*�*�',��$�$���#�#�� � �c�3�/�/��� � ��'�'�'�'���(�(�%*��"�"���'�'�/��6�6����&�&�#)�)�#4�#:�#:�#<�#<�D�L����'�'�/��U���=�=��$'�� � �:�q�(A�(A�$B�$B��!�$*�J�J�x��$D�$D��!�!��,�,�,�%;�E�%B�%B��"�"��+�+�+���&�&�)?��)F�)F�D�&��; G�� Gr%���a��� 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 >>> from datetime import datetime >>> 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` rE���c�����������������r�����|�j����������*d}|�j��������rt����������|�j��������������������d���������}||�_���������|�j���������S�)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`Nr<���r���)r����r����r���)rj����nums��� r#����num_pluralszCatalog.num_plurals(��sA���������$��C��{�� 1� ���-�-�a�0�� #�D��� � r%���c�����������������r�����|�j����������*d}|�j��������rt����������|�j��������������������d���������}||�_���������|�j���������S�)aW��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: `str`Nr��r;���)r����r����r���)rj����exprs��� r#����plural_exprzCatalog.plural_expr9��sA���������$��D��{�� 2�!�$�+�.�.�q�1�� $�D��� � r%���c�����������������(�����d|�j�����������d|�j����������d�S�)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`z nplurals=z ; plural=�;)r��r��rq���s��� r#���r����zCatalog.plural_formsL��s$�������J�4�+�I�I�d�6F�I�I�I�Ir%���rS���r���c�����������������:�����|�����������������������|������������|�j��������v�S�)z?Return whether the catalog has a message with the specified ID.��_key_forr�����rj���rS���s��� r#����__contains__zCatalog.__contains__X��s�������}�}�R� � �D�N�2�2r%���c�����������������*�����t����������|�j��������������������S�)zeThe number of messages in the catalog. This does not include the special ``msgid ""`` entry.)�lenr����rq���s��� r#����__len__zCatalog.__len__\��s��������4�>�"�"�"r%����Iterator[Message]c��������������#�����K����g�}|�j���������D�]\��}}|���������������������|��d|����������������� t������������������������}|�j��������r|dhz��}t ����������dd���������������������|������������|�������������V���|�j��������D�]}|�j��������|���������V����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: r����rR���r����r����N)�mime_headersr,���re���r����r���r ��r����)rj����bufr��r4���rX����keys��� r#����__iter__zCatalog.__iter__b��s����������� ����,�� +�� +�K�D�%��J�J�$�)�)�%�)�)�*�*�*�*������:�� ��g�Y��E��b�$�)�)�C�.�.��6�6�6�6�6�6��>�� &�� &�C��.��%�%�%�%�%� &�� &r%���c�����������������l�����d}|�j���������r d|�j������������}dt����������|�������������j����������d|�j���������|��d�S�)NrR���rn���rm����>)r����ro���rp���r����r����s��� r#���rr���zCatalog.__repr__q��sI���������;�� '�&���&�&�F�A�4��:�:�&�A�A���A��A�A�A�Ar%���c�����������������0�����|�����������������������|�������������dS�)z)Delete the message with the specified ID.N)�deleter��s��� r#����__delitem__zCatalog.__delitem__w��s���������B�����r%���r���c�����������������,�����|�����������������������|������������S�)zUReturn the message with the specified ID. :param id: the message ID )r��r��s��� r#����__getitem__zCatalog.__getitem__{��s������ ��x�x��|�|�r%����messagec����������������������t����������|t����������������������s J�d���������������|����������������������||j��������������������}|�j�����������������������������|������������}|r�|j��������r|j��������s|j��������|_��������|j��������|_��������t����������t����������|j��������|j��������z���������������������������|_��������t����������t����������|j��������|j��������z���������������������������|_��������t����������t����������|j ��������|j ��������z���������������������������|_ ��������|xj��������|j��������z��c_��������|}dS�|dk����rbt����������|j�������������������������������������������������������|�_��������d���������������������d��|j ��������D���������������������������|�_��������|j��������|�_��������dS�t����������|t����������t*����������f������������r@t����������|j��������t����������t*����������f������������sJ�dt-����������|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 objectrR���r����c�����������������<�����g�|�]}d�|�����������������������������������������S�)z# )�rstrip)r ����cs��� r#���r$���z'Catalog.__setitem__.<locals>.<listcomp>���s(������,^�,^�,^�1�X�!�X�X�_�_�->�->�,^�,^�,^r%���zExpected sequence but got N)ri���r���r��r_���r����r��rc���rS���rT���rd���r���rV���rZ���r[���rX���r ����itemsr"��r ��r����r����r����ro���)rj���rS���r-��r$���currents��� r#����__setitem__zCatalog.__setitem__���s������,��'�7�+�+�H�H�-H�H�H�+��m�m�B���0�0���.�$�$�S�)�)���� *��#�� 0�G�,@�� 0�$�Z�� �!(���� $�X�g�.?�.5�.?�/@��&A��&A��!B��!B�G��$(��'�2G�29�2G�3H��*I��*I��%J��%J�G�!�$(��'�2G�29�2G�3H��*I��*I��%J��%J�G�!��M�M�W�]�*�M�M��G�G�G� �2�X�X� 3�G�N� C� C� I� I� K� K�D��"&�)�)�,^�,^��H]�,^�,^�,^�"_�"_�D�� ��D�J�J�J��"�t�U�m�,�,�� H�!�'�.�4��-�@�@��H��H�G��g�n�1E�1E�G�G�H��H�@�")�D�N�3���r%���r���rU���rV���rW���rX���rY���rZ���r[���r\���r]���r^���r_���c �����������������Z�����t����������||t����������|������������|||||| �� ��� ��������} | |�|<���| S�)at��Add 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 )r]���r_���)r���rd���)rj���rS���rT���rV���rX���rZ���r[���r\���r]���r_���r-��s��� r#���rg���zCatalog.add���sC������J��"�f�d�9�o�o�u�m�'��V�")�+��+��+�����R���r%����0Iterable[tuple[Message, list[TranslationError]]]c��������������#���~���K����|�j��������������������������������������������D�] }|���������������������|��������������}|r||fV����!dS�)a\��Run 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: ``generator`` of ``(message, errors)`` )r����N)r�����valuesr����)rj���r-��r����s��� r#���r����z Catalog.check���s[������������~�,�,�.�.�� &�� &�G��]�]�4�]�0�0�F��� &��v�o�%�%�%�� &�� &r%����Message | Nonec�����������������^�����|�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��)rj���rS���r_���s��� r#���r��zCatalog.get���s(��������~�!�!�$�-�-��G�"<�"<�=�=�=r%���c�����������������X�����|�����������������������||������������}||�j��������v�r |�j��������|=�dS�dS�)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���rj���rS���r_���r$��s��� r#���r)��zCatalog.delete���s<��������m�m�B��(�(���$�.� � ���s�#�#�#��!� r%���F�template�no_fuzzy_matching�update_header_comment�keep_user_commentsc�����������������������������j�����������������������������������������������t��������������������������_���������g�}|sei�}�D�]`}|r\�|���������j��������rO�����������������������|������������}�|���������j��������}|����������������������������������������������������������������������} ||f|| <����at�������������������������d������fd�} |D�]�}|j ��������rΉ����������������������|j ��������|j��������������������}|�v�r�| |||��������������;|s�t����������|t����������������������r |d ���������}n|}t����������|����������������������������������������������������������������������|� ����������������������������������d ������������} | r'| d ���������} || ���������\��}}|�||f}�| |||���������������|��|j ��������<����؉D�]}|s|�vr�|�����������j��������|<����|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 r-��r����oldkey�tuple[str, str] | str�newkeyr6���ra���c�����������������*�����|�������������������������������������}�d}||k����rrd}����������������������|�����������������������������������|������������}|�J��t����������|j��������t ����������������������r|j��������g|�_��������n4t����������|j��������������������|�_��������n����������������������|d�������������}|�J��|j ��������|�_ ���������r&t����������t����������|j��������������������������������|�_��������t����������|�j��������t����������t����������f������������r�t����������|�j ��������t����������t����������f������������s9d}t����������|�j ��������gdgt����������|�j��������������������dz ��z��z���������������|�_ ��������n�t����������|�j ��������������������� j��������k����r5d}t����������|�j ��������d�t����������|j ������������������������������������������|�_ ��������n5t����������|�j ��������t����������t����������f������������rd}|�j ��������d���������|�_ ��������|�xj��������|j��������z��c_��������|r|�xj��������dhz��c_��������|�� |�j��������<���d�S�)NFTrR���r;���r���r����)r����rg���r��ri���rS���r5���r\���rd����poprT���r���r[���r����r��r��rX���) r-��rB��rD��r�����oldmsg� fuzzy_matchesr@���messages� remainingrj���s ��� �����r#����_mergezCatalog.update.<locals>._mergeI��s��������m�m�o�o�G��E��������!�!�&�)�)�)�!���f�-�-���)�)�)��f�i��-�-��:�+1�9�+�G�'�'�*.�v�y�/�/�G�'�'�"���v�t�4�4���)�)�)�#�]�G�N�!�� M�(,�X�f�6J�-K�-K�(L�(L��%��'�*�t�U�m�4�4�� 3�!�'�.�4��-�@�@��P� �E�%*� ��(�R�D�C�� �O�O�a�4G�,H�I�&��&�G�N�N�����(�(�D�,<�<�<� �E�%*�7�>�:M�3�v�}�;M�;M�:M�+N�%O�%O�G�N���G�N�T�5�M�:�:�� 3���!(���!2����M�M�V�\�)�M�M��� +�� � �'��*� � �&�D�����r%���r���r;���N)r-��r���rB��rC��rD��rC��r6���ra���)r����r���r���rT���r��r_���r���stripre���rS���ri���r����r3����keysr����r����r����)rj���r=��r>��r?��r@���fuzzy_candidates�msgidr$���ctxt�modified_keyrK��r-���matchkey�matchesrD���newctxtrH��rI��rJ��s���` ` @@@r#����updatezCatalog.update���sN����������v��>���M�M�O�O� �$�������� �� A�!��!�� A�� A����A�X�e�_�3��A��-�-��.�.�C�#�E�?�2�D�#&�9�9�;�;�#4�#4�#6�#6�L�69�4�[�$�\�2����� �# '��# '��# '��# '��# '��# '��# '��# '��# '��# '�J� �� /�� /�G��z�� /��m�m�G�J���@�@���(�?�?��F�7�C��-�-�-�-�,��%�%�c�5�1�1��+�'*�1�v�H�H�'*�H�"3�H�N�N�4D�4D�4J�4J�4L�4L�4D�4I�4I�4K�4K�Q�#P��#P��"��%�+2�1�:�L�.>�|�.L�O�F�G�&�2�)/����"�F�7�F�C�8�8�8�$�'.�D���$���� 8�� 8�E� �� 8�E��$>�$>�'0��'7�� �e�$�� �� :��#+�"9�D���&�3����r%���rC��c�����������������^�����|}t����������|t����������t����������f������������r|d���������}|�||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. r���)ri���rd���r����r<��s��� r#���r��zCatalog._key_for���s<������ ����c�D�%�=�)�)�� ��Q�%�C�����.�C�� r%���rs���c�����������������|����t����������|t����������������������sJ��|�j�������������������������������������������|j�������������������������������������������z��D�]H}|����������������������|������������}|���������������������|������������}|�|�|���������������������|������������s�dS��It ����������|�j��������������������t ����������|j��������������������k����S�)z\Checks if catalogs are identical, taking into account messages and headers. NF)ri���r���r����rM��r��r����r����r"��)rj���rs���r$��� message_1� message_2s��� r#���r����zCatalog.is_identical���s���������%��)�)�)�)�)��>�&�&�(�(�5�?�+?�+?�+A�+A�A�� �� �C����� � �I�� � �#���I��!��$� �-�-�i�8�8��%���u�u��%���D�%�&�&�$�u�/A�*B�*B�B�Br%���)r����r����r����r`���r����r`���r����r`���r����r`���r����r`���r����r`���r����r����r����r����r����r`���r����r`���r����r`���r����rz���r6���ra���)r����r����r6���ra���)r6���r����)r6���r`���r����)rT���r`���r6���ra���)r6���r����)r����r����)r2���r����r����r5���r����r5���r6���r5���)r����r����r6���ra���)r6���rE���)rS���r���r6���rz���)r6���r ��)rS���r���r6���ra���)rS���r���r6���r���)rS���r���r-��r���r6���ra���)Nr���r���r���r���r���NN)rS���r���rT���rU���rV���rW���rX���rY���rZ���rY���r[���rY���r\���r���r]���r^���r_���r`���r6���r���)r6���r6��r����)rS���r���r_���r`���r6���r9��)rS���r���r_���r`���r6���ra���)FFT) r=��r���r>��rz���r?��rz���r@��rz���r6���ra���)rS���r���r_���r`���r6���rC��)rs���r���r6���rz���)$rp���r����r����r�����DEFAULT_HEADERrk���r����r����r����r����r����r����r����r����r����r����r����r��r"��r��r��r����r��r��r%��rr���r*��r,��r4��rg���r����r��r)��rU��r��r����r���r%���r#���r���r�����sJ�������������.�.��'+�!�%3�"�"�'+�)-�8<�PT�&*�$(�"��D!��D!��D!��D!��D!�Lk��k��k��k�*�������'��'��'��'���X�k�;� /� /�F� ��!7�8�8���������&��&��&��&���X�1�3F��M�� �� �� �N�B�������<���������G��G��G��G�@��8�-�/@��2G��2 ��2 ��2 �L�h��!��!��!���X�!� ��!��!��!���X�!�$�� J�� J�� J���X� J�3��3��3��3�#��#��#��#� &�� &�� &�� &�B��B��B��B���������������/*��/*��/*��/*�h�%)�/1�!�')�')�"$�!�"�)��)��)��)��)�V&��&��&��&�>��>��>��>��>�$��$��$��$��$��#(�&+�#'�S4��S4��S4��S4��S4�j �� �� �� �� �C��C��C��C��C��Cr%���r���)r���r���)r4���r5���r6���r7���)r4���r5���r6���r����)5r����� __future__r���r9���rA����collectionsr����collections.abcr���r���r����difflibr����emailr ����heapqr ����typingr����babelr���r����� babel.corer ���r����babel.datesr����babel.messages.pluralsr���� babel.utilr���r���r���r����typing_extensionsr���r5���r����rd���r����__annotations__�__all__r3����compile�VERBOSEr����rP���r���� Exceptionr���rZ��r����r���r���r%���r#����<module>rm�����s�����������#��"��"��"��"��"������� � � � ��#��#��#��#��#��#��.��.��.��.��.��.��.��.��������������#��#��#��#��#��#��%��%��%��%��%��%�������������� �� �� �� �� �� ��(��(��(��(��(��(��1��1��1��1��1��1��1��1��'��'��'��'��'��'��-��-��-��-��-��-��C��C��C��C��C��C��C��C��C��C��C��C���>�+�+�+�+�+�+��%��S��/�1�D��I�=�J�=�=�=�=� 4� 4� 4��&��&��&��&�4��� �� ���Z� �� � ��������<W;��W;��W;��W;��W;��W;��W;��W;�t%��%��%��%��%�y��%��%��%� �� �� �� �� �W C��W C��W C��W C��W C��W C��W C��W C��W C��W Cr%���