HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
Disabled: NONE
Upload Files
File: //kunden/lib/python3/dist-packages/breezy/__pycache__/bzr_distutils.cpython-39.pyc
a

�*�^��@sddZddlmZddlmZddlmZddlmZddl	m
Z
ddlZddlZGdd	�d	e�Z
dS)
zbuild_mo command for setup.py�)�absolute_import)�log)�Command)�newer)�find_executableNc@s:eZdZdZdZgd�ZdgZdd�Zdd�Zd	d
�Z	dS)�build_moz%Subcommand of build command: build_mozcompile po files to mo files))z
build-dir=�dzDirectory to build locale files)zoutput-base=�ozmo-files base name)zsource-dir=NzDirectory with sources po files)�force�fzForce creation of mo files)zlang=Nz,Comma-separated list of languages to processr
cCs"d|_d|_d|_d|_d|_dS)N)�	build_dir�output_base�
source_dirr
�lang)�self�r�6/usr/lib/python3/dist-packages/breezy/bzr_distutils.py�initialize_options4s
zbuild_mo.initialize_optionscCs�|�dd�|j��|_|jdur(d|_|js:|jp6d|_|jdurJd|_|jdur�t�	d�}g|_t
�|j�D]$}|�|�}|rp|j�
|�d��qpndd	�|j�d
�D�|_dS)NZbuild)r
r
z
breezy/locale�messages�poz^([a-zA-Z_]+)\.po$�cSsg|]}|��r|���qSr)�strip)�.0�irrr�
<listcomp>L�z-build_mo.finalize_options.<locals>.<listcomp>�,)Zset_undefined_optionsZdistributionZget_name�prj_namerr
rr�re�compile�os�listdir�match�append�group�split)rZre_por�morrr�finalize_options;s 




zbuild_mo.finalize_optionsc
Cs`|js
dStd�dur.t�d�t�d�dSd|jvr�td�durZt�d�t�d�nNt�d	�|jpld
d}d}|�dd
dddtj�	|j
|�dtj�	|j
|�g�|j}|�d�s�|d7}|jD]�}tj�	d|d�}tj�
|�s�tj�	d|d�}tj�	|j|d�}|�|�tj�	||�}|j�s6t||�r�t�d||f�|�dd||g�q�dS)zRun msgfmt for each languageNZmsgfmtz%GNU gettext msgfmt utility not found!zSkip compiling po files.ZenZmsginitz&GNU gettext msginit utility not found!zSkip creating English PO file.zCreating English PO file...rz.potzen.poz--no-translatorz-lz-iz-oz.morz.po�LC_MESSAGESzCompile: %s -> %s)rrr�warn�inforZspawnr �path�joinrr
�endswith�isfilerZmkpathr
r)rZpotZen_po�basenamerrZdir_r&rrr�runNs@




�


zbuild_mo.runN)
�__name__�
__module__�__qualname__�__doc__ZdescriptionZuser_optionsZboolean_optionsrr'r0rrrrr!sr)r4Z
__future__rZ	distutilsrZdistutils.corerZdistutils.dep_utilrZdistutils.spawnrr rrrrrr�<module>s