| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/babel/messages/__pycache__/ |
Upload File : |
a
�4d� � @ sL d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl m
Z
d dlmZ d dl
mZ d dlmZ d dlmZmZ d dlmZ d dlmZ d d lmZmZ d d
lmZmZmZmZ d dl m!Z! d dl"m#Z#m$Z$ d d
l%m&Z& e�'d�Z(zNd dl)m*Z+ e(Z,zd dl-m.Z.m/Z/m0Z0 W n e1�yD e2 Z/ Z0Z.Y n0 W nP e1�y� d dl3m(Z, d dl4m*Z+ d dl5m6Z. d dl5m7Z/ d dl5m8Z0 Y n0 d0dd�Z9G dd� de+�Z*G dd� de*�Z:dd� Z;G dd� de*�Z<dd � Z=G d!d"� d"e*�Z>G d#d$� d$e*�Z?G d%d&� d&�Z@d'd(� ZAd1d)d*�ZBd2eeC d,�d-d.�ZDeEd/k�rHeA� dS )3� N)�OrderedDict)�RawConfigParser)�StringIO)�Iterable)�Locale�
localedata)�__version__)�UnknownLocaleError)�DEFAULT_HEADER�Catalog)�DEFAULT_KEYWORDS�DEFAULT_MAPPING�check_and_call_extract_file�extract_from_dir)�write_mo)�read_po�write_po)�LOCALTZ�babel)�Command)� BaseError�OptionError�
SetupError)�log)�DistutilsError)�DistutilsOptionError)�DistutilsSetupErrorc C sp g }t | ttf�s| g} | D ]N}|d u r*qt |ttf�rL|�t||d�� q|�dd� t|��|�D �� q|S )N��splitc s s | ]}|� � V qd S �N��strip)�.0�s� r$ �;/usr/lib/python3.9/site-packages/babel/messages/frontend.py� <genexpr>` � z listify_value.<locals>.<genexpr>)�
isinstance�list�tuple�extend�
listify_value�strr )�argr �out�valr$ r$ r% r, ; s r, c @ s. e Zd ZdZdZdZi Zi ZeZ ddd�Z
dS )r Nr$ c C s0 || _ | �� d | _d| _d | _d| _d| _d S )NFr )�distribution�initialize_optionsZ_dry_run�verbose�force�helpZ finalized)�self�distr$ r$ r% �__init__� s zCommand.__init__)N)�__name__�
__module__�__qualname__�as_args�multiple_value_options�boolean_options�option_aliases�option_choices�
distutils_logr r8 r$ r$ r$ r% r e s r c @ s@ e Zd ZdZg d�ZddgZdd� Zdd� Zd d
� Zdd� Z d
S )�compile_catalogz+compile message catalogs to binary MO files))�domain=�Dz>domains of PO files (space separated list, default 'messages'))z
directory=�d�.path to base directory containing the catalogs�zinput-file=�izname of the input file)�output-file=�ozQname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.mo')��locale=�lz locale of the catalog to compile)� use-fuzzy�fzalso include fuzzy translations)�
statisticsNz#print statistics about translationsrN rP c C s. d| _ d | _d | _d | _d | _d| _d| _d S �N�messagesF)�domain� directory�
input_file�output_file�locale� use_fuzzyrP �r6 r$ r$ r% r2 � s z"compile_catalog.initialize_optionsc C s8 t | j�| _| js | js td��| js4| js4td��d S )Nz<you must specify either the input file or the base directoryz=you must specify either the output file or the base directory)r, rS rU rT r rV rY r$ r$ r% �finalize_options� s
z compile_catalog.finalize_optionsc C sN d}| j D ]$}| �|��� D ]}|t|�7 }qq
|rB| j�d|� |rJdS dS )Nr z%d errors encountered.� )rS �_run_domain�values�lenr �error)r6 Zn_errorsrS �errorsr$ r$ r% �run� s
zcompile_catalog.runc
C s� g }g }| j s�| jr`|�| jtj�| j| jd|� d��f� |�tj�| j| jd|� d��� nft�| j�D ]X}tj�| j|d|� d��}tj�|�rl|�||f� |�tj�| j|d|� d��� qlnH|�| j| j f� | j r�|�| j � n"|�tj�| j| jd|� d��� |�st
d��i }t|�D �]h\}\}}|| }t|d��} t
| |�}
W d � n1 �sl0 Y | j�r�d}t|
�dd � D ]}|j�r�|d7 }�q�d}
t|
��r�|d t|
� }
| j�d |t|
�|
|� |
j�r| j�s| j�d
|� �q*t|
�� � ||
<