Your IP : 216.73.216.213
�
�#�j� � �, � d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZm Z d dl
mZ ee� dz dz dz Z e j de j � Z e j d � Zd
d�d�Zd
� Zd� Z e � G d� dej( � � Zd� Zy)� N)�Path)� REPO_ROOT�
TEST_HOME_DIR�requires_subprocess)�skip_if_missing�Tools�i18nzpygettext.pyz)msgid(.*?)(?:msgid_plural|msgctxt|msgstr)z"((?:\\"|[^"])*)"T��stdout_onlyc � � t j t j t ddd| gt j
t j
d�� }|r|j S |S )Nz
--no-locationz-o�-T)�stdout�stderr�text)�
subprocess�run�sys�
executable� pygettext�PIPEr )�pathr �ress �?/opt/alt/python312/lib64/python3.12/test/support/i18n_helper.py�_generate_po_filer sJ � �
�.�.�#�.�.�)�)�4��d�<� *���
���"�$�C� ��z�z���J� c �� � g }t j | � D ]L }dj t j |� � }|j dd� }|s�<|j |� �N t
|� S )N� z\"�")�
msgid_pattern�findall�join�msgid_string_pattern�replace�append�sorted)�po�msgids�msgid�msgid_strings r �_extract_msgidsr* sc � �
�F��&�&�r�*���w�w�3�;�;�E�B�C��#�+�+�E�3�7����M�M�,�'� +�
�&�>�r c �2 � t t � dz | z dz S )N�translationdataz
msgids.txt)r r )�module_names r �_get_snapshot_pathr. % s � ��
��!2�2�[�@�<�O�Or c � � e Zd Zd� Zy)�TestTranslationsBasec �n � t d� t |j d�� }| j |j d� | j |j
d� t
|j � }t |j � }|j � j � }| j ||� y )Nr Fr
r r )
r r �__file__�assertEqual�
returncoder r* r r. �__name__� read_text�
splitlines�assertListEqual)�self�moduler r'