403Webshell
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 :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/babel/messages/__pycache__/frontend.cpython-39.opt-2.pyc
a

�4d��@sLddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZddlmZddlmZmZddlmZddlmZdd	lmZmZdd
lmZmZmZmZddl m!Z!ddl"m#Z#m$Z$dd
l%m&Z&e�'d�Z(zNddl)m*Z+e(Z,zddl-m.Z.m/Z/m0Z0Wn e1�yDe2Z/Z0Z.Yn0WnPe1�y�ddl3m(Z,ddl4m*Z+ddl5m6Z.ddl5m7Z/ddl5m8Z0Yn0d0dd�Z9Gdd�de+�Z*Gdd�de*�Z:dd�Z;Gdd�de*�Z<dd �Z=Gd!d"�d"e*�Z>Gd#d$�d$e*�Z?Gd%d&�d&�Z@d'd(�ZAd1d)d*�ZBd2eeCd,�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)�DistutilsSetupErrorcCspg}t|ttf�s|g}|D]N}|dur*qt|ttf�rL|�t||d��q|�dd�t|��|�D��q|S)N��splitcss|]}|��VqdS�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.eZdZdZdZdZiZiZeZ	ddd�Z
dS)rNr$cCs0||_|��d|_d|_d|_d|_d|_dS)NFr)�distribution�initialize_optionsZ_dry_run�verbose�force�helpZ	finalized)�self�distr$r$r%�__init__�szCommand.__init__)N)�__name__�
__module__�__qualname__�as_args�multiple_value_options�boolean_options�option_aliases�option_choices�
distutils_logrr8r$r$r$r%resrc@s@eZdZdZgd�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 translationsrNrPcCs.d|_d|_d|_d|_d|_d|_d|_dS�N�messagesF)�domain�	directory�
input_file�output_file�locale�	use_fuzzyrP�r6r$r$r%r2�sz"compile_catalog.initialize_optionscCs8t|j�|_|js |js td��|js4|js4td��dS)Nz<you must specify either the input file or the base directoryz=you must specify either the output file or the base directory)r,rSrUrTrrVrYr$r$r%�finalize_options�s
z compile_catalog.finalize_optionscCsNd}|jD]$}|�|���D]}|t|�7}qq
|rB|j�d|�|rJdSdS)Nrz%d errors encountered.�)rS�_run_domain�values�lenr�error)r6Zn_errorsrS�errorsr$r$r%�run�s
zcompile_catalog.runc
Cs�g}g}|js�|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|jf�|j	r�|�|j	�n"|�tj�|j|jd|�d���|�st
d��i}t|�D�]h\}\}}||}t|d��}	t
|	|�}
Wd�n1�sl0Y|j�r�d}t|
�dd�D]}|j�r�|d7}�q�d}
t|
��r�|dt|
�}
|j�d	|t|
�|
|�|
j�r|j�s|j�d
|��q*t|
���||
<}|D]*\}}|D]}|j�d||j|��q&�q|j�d||�t|d
�� }t||
|jd�Wd�n1�s�0Y�q*|S)N�LC_MESSAGES�.poz.mo�no message catalogs found�rbrr[�dz)%d of %d messages (%d%%) translated in %sz'catalog %s is marked as fuzzy, skippingzerror: %s:%d: %szcompiling catalog %s to %s�wb)rX)rUrW�append�os�path�joinrT�listdir�existsrVr�	enumerate�openrrPr)�stringr^r�info�fuzzyrX�checkr_�linenor)r6rS�po_filesZmo_filesrW�po_fileZcatalogs_and_errors�idxZmo_file�infile�catalogZ
translated�messageZ
percentageZcatalog_errorsr`r_�outfiler$r$r%r\�s~���
��
�*
�
�4zcompile_catalog._run_domainN)
r9r:r;�description�user_optionsr>r2rZrar\r$r$r$r%rB�s		rBcs�fdd�}|S)Ncs$tj�|��t�fdd��D��S)Nc3s|]}t��|�VqdSr)�fnmatch)r"Zignore_pattern��basenamer$r%r&s�zG_make_directory_filter.<locals>.cli_directory_filter.<locals>.<genexpr>)rirjr��any)�dirname��ignore_patternsrr%�cli_directory_filters�z4_make_directory_filter.<locals>.cli_directory_filterr$)r�r�r$r�r%�_make_directory_filtersr�c@sleZdZdZgd�Zgd�ZdZdZdddd	d
�ZddiZ	d
d�Z
dd�Zed�dd�Z
dd�Zdd�ZdS)�extract_messagesz1extract localizable strings from the project code))zcharset=Nz3charset to use in the output file (default "utf-8"))z	keywords=�kzispace-separated list of keywords to look for in addition to the defaults (may be repeated multiple times))�no-default-keywordsNz#do not include the default keywords)z
mapping-file=�Fz&path to the mapping configuration file)�no-locationNz>do not include location comments with filename and line number)z
add-location=Nz�location lines format. If it is not given or "full", it generates the lines with both file name and line number. If it is "file", the line number part is omitted. If it is "never", it completely suppresses the lines (same as --no-location).)�omit-headerNz'do not include msgid "" entry in header)rIrJzname of the output file�zwidth=�wz"set output line width (default 76)��no-wrapNzVdo not break long message lines, longer than the output line width, into several lines)�sort-outputNz&generate sorted output (default False))�sort-by-fileNz,sort output by file location (default False))zmsgid-bugs-address=Nzset report address for msgid)zcopyright-holder=Nzset copyright holder in output)zproject=Nzset project name in output)zversion=Nzset project version in output)z
add-comments=�czuplace comment block with TAG (or those preceding keyword lines) in output file. Separate multiple TAGs with commas(,))�strip-commentsr#z)strip the comment TAGs from the comments.)zinput-paths=Nzofiles or directories that should be scanned for messages. Separate multiple files or directories with commas(,))zinput-dirs=Nz@alias for input-paths (does allow files as well as directories).)zignore-dirs=NzwPatterns for directories to ignore when scanning for messages. Separate multiple patterns with spaces (default ".* ._"))zheader-comment=Nzheader comment for the catalog)r�r�r�r�r�r�r�zinput-paths)zadd-comments�keywordszignore-dirs)z	--keyword)z	--mapping)z--output)z--strip-comment-tags)r�zmapping-filezoutput-filer�zadd-location)Zfull�file�nevercCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nzutf-8FT)�charsetr��no_default_keywords�mapping_file�no_location�add_location�omit_headerrV�
input_dirs�input_paths�width�no_wrap�sort_output�sort_by_file�msgid_bugs_address�copyright_holder�project�version�add_comments�strip_comments�include_lineno�ignore_dirs�header_commentrYr$r$r%r2}s.z#extract_messages.initialize_optionscCs�|jr|js|j|_ntd��|jr(int��}|�tt|j	���||_	|j	sXtd��|j
sftd��|jrz|jrztd��|js�|js�d|_n|jdur�t
|j�|_|jr�|jr�td��|jr�t|jt�r�t�d|j�|_n6|jdu�rt�dd	�|jjp�d
D����|_ng|_|j�s"td��|jD]$}tj�|��s(td|�d
����q(t|j�pZd
d�|_|j�r�|j�s~|j��|_|j�s�|j� �|_|j!dk�r�d|_"n|j!dk�r�d|_#t|j$�}|�r�t%|j$�|_&nd|_&dS)Nz1input-dirs and input-paths are mutually exclusivez=you must specify new keywords if you disable the default oneszno output file specified�0'--no-wrap' and '--width' are mutually exclusive�Lz;'--sort-output' and '--sort-by-file' are mutually exclusivez,\s*cSsg|]}|�dd�d�qS)�.r[rr)r"r�r$r$r%�
<listcomp>�s�z5extract_messages.finalize_options.<locals>.<listcomp>r$z'no input files or directories specifiedzInput path: z does not exist�,r�Tr�F)'r�r�rr�r�copy�update�parse_keywordsr,r�rVr�r��intr�r�r(r-�rerr1�dict�fromkeysZpackages�keysrirjrmr�r�Zget_namer�Zget_versionr�r�r�r�r��directory_filter)r6r�rjr�r$r$r%rZ�sl
���
�

�

z!extract_messages.finalize_options)rjcstttd���fdd�}|S)N)�filename�method�optionscst|dkrdStj���r�}ntj�tj��|��}d}|r`d�dd�|��D��}d|�d�}�j�d||�dS)	N�ignore�z, css"|]\}}|�d|�d�VqdS)z="�"Nr$)r"r��vr$r$r%r&�r'zEextract_messages._build_callback.<locals>.callback.<locals>.<genexpr>z (�)zextracting messages from %s%s)rirj�isfile�normpathrk�itemsrrq)r�r�r��filepathZoptstrZ
opt_values�rjr6r$r%�callback�sz2extract_messages._build_callback.<locals>.callback)r-r�)r6rjr�r$r�r%�_build_callback�sz extract_messages._build_callbackcCsV|��}t|jd���*}t|j|j|j|j|j|j	p6t
d�}|D]�\}}}|�|�}tj
�|�r�t��}t|||||j|j|j|�}	n t||||j|j||j|jd�}	|	D]P\}
}}}
}tj
�|�r�|
}ntj
�tj
�||
��}|j|d||fg|
|d�q�q@|j�d|j�t|||j|j|j|j|j |j!d�Wd�n1�sH0YdS)Nrg)r�r�r�r�r�r�)r�Zcomment_tagsr�Zstrip_comment_tagsr�)Z
auto_comments�contextzwriting PO template file to %s)r�r�r�r�r�r�)"�
_get_mappingsrorVrr�r�r�r�r�r�r
r�rirjr��getcwdrr�r�r�rr�r�rk�addrrqrr�r�r�r�r�r�)r6�mappingsr{ryrj�
method_map�options_mapr�Zcurrent_dirZ	extractedr�rtrzZcommentsr�r�r$r$r%ra�sR�

���

�zextract_messages.runcCsg}|jr^t|j��}t|�\}}Wd�n1s60Y|jD]}|�|||f�qFn�t|jdd�r�|jj}|��D]h\}}t	|t
�r�tt|��\}}n4gi}}|D]$\}}	}
|�||	f�|
p�i||<q�|�|||f�q|n|jD]}|�|tif�q�|S)N�message_extractors)
r�ro�
parse_mappingr�rh�getattrr1r�r�r(r-rr
)r6r��fileobjr�r�rjr��mapping�patternr�r�r$r$r%r�!s&*



zextract_messages._get_mappingsN)r9r:r;r|r}r>r<r=r?r@r2rZr-r�rar�r$r$r$r%r�#s"6��I-r�cCst|t�std��dS)NzDthe value of the "message_extractors" parameter must be a dictionary)r(r�r)r7�name�valuer$r$r%�check_message_extractors=s

�r�c@s6eZdZdZgd�ZdgZdd�Zdd�Zdd	�Zd
S)�init_catalogz(create a new catalog based on a POT file)�rCrDz&domain of PO file (default 'messages')rG)�output-dir=rEzpath to output directory�rIrJzQname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.po'))rLrMz$locale for the new localized catalogr�r�r�cCs.d|_d|_d|_d|_d|_d|_d|_dSrQ)�
output_dirrVrUrWrSr�r�rYr$r$r%r2rszinit_catalog.initialize_optionsc
Cs|jstd��|jstd��zt�|j�|_Wn.ty\}zt|�|�WYd}~n
d}~00|jsr|jsrtd��|js�t	j
�|j|jd|j�d��|_t	j
�
t	j
�|j��s�t	�t	j
�|j��|jr�|jr�td��|js�|js�d|_n|jdu�rt|j�|_dS)N�you must specify the input filez-you must provide a locale for the new catalogz%you must specify the output directoryrbrcr�r�)rUrrWr�parse�_localer	rVr�rirjrkrSrmr��makedirsr�r�r��r6�er$r$r%rZ{s, �zinit_catalog.finalize_optionscCs�|j�d|j|j�t|jd��}t||jd�}Wd�n1sD0Y|j|_tj�	t
�|_d|_t|jd�� }t
|||jd�Wd�n1s�0YdS)N�creating catalog %s based on %sre�rWFrg)r�)rrqrVrUrorrWr��datetime�nowr�
revision_daterrrr�)r6rxryr{r$r$r%ra�s
�,zinit_catalog.runN�	r9r:r;r|r}r>r2rZrar$r$r$r%r�Ns	r�c@s8eZdZdZgd�Zgd�Zdd�Zdd�Zdd	�Zd
S)�update_catalogz'update message catalogs from a POT file)r�rG)r�rErFr�)r�Nz%do not include msgid  entry in headerrKr�r�)zignore-obsolete=Nz1whether to omit obsolete messages from the output)z
init-missing=Nz6if any output files are missing, initialize them first)�no-fuzzy-matching�Nzdo not use fuzzy matching)�update-header-commentNzupdate target header comment)�previousNz+keep previous msgids of translated messages)zcheck=Nz�don't update the catalog, just return the status. Return code 0 means nothing would change. Return code 1 means that the catalog would be updated)r�r�zignore-obsoletezinit-missingr�r�r�rscCsXd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
dSrQ)rSrUr�rVr�rWr�r��ignore_obsolete�init_missing�no_fuzzy_matching�update_header_commentr�rsrYr$r$r%r2�sz!update_catalog.initialize_optionsc
Cs�|jstd��|js"|js"td��|jr6|js6td��|jr�|jsJtd��zt�|j�|_Wq�t	y�}zt|�|�WYd}~q�d}~00nd|_|j
r�|jr�td��|j
s�|js�d|_n|jdur�t|j�|_|j
r�|jr�d|_dS)Nr�z-you must specify the output file or directoryzyou must specify the localez?you must specify the locale for the init-missing option to workr�r�F)rUrrVr�rWr�rr�r�r	r�r�r�r�r�r�r$r$r%rZ�s0�"
zupdate_catalog.finalize_optionsc
Csi}g}|js�|jr@|�|jtj�|j|jd|j�d��f�q�t�|j�D]:}tj�|j|d|j�d��}tj�	|�rL|�||f�qLn|�|j|jf�|s�t
d��|j}|s�tj�tj�|j
��d}t|j
d��}t|�}Wd�n1s�0Y|D�]�\}}|j�r�tj�	|��s�|j�r8d||<�q|j�d||j
�t|j
d��}t||jd�}	Wd�n1�s|0Y|j|	_tj�t�|	_d|	_t|d	��}
t|
|	�Wd�n1�s�0Y|j�d
||j
�t|d��}t|||d�}	Wd�n1�s0Y|	j||j|jd�tj�tj�|�t� �tj�|��}zLt|d	��,}t||	|j!|j"|j#|j$d
�Wd�n1�s�0YWn t%�y�t�&|��Yn0|j�r`t|d��}
t|
�}Wd�n1�s�0Yt|d��}t|�}Wd�n1�s20Y|j|_|�'|�||<t�&|��qzt�(||�Wn4t)�y�t�&|�t*�+||�t�&|�Yn0�q|j�r|�,�D].\}}|�r�|j�d|�n|j�-d|��q�t.|�/���st0d��n|j�d�dSdS)NrbrcrdrreFr�r�rgzupdating catalog %s based on %s)rWrS)r�)r�r�Zinclude_previousr�zCatalog %s is up to date.zCatalog %s is out of date.zSome catalogs are out of date.z All the catalogs are up-to-date.)1rVrWrhrirjrkr�rSrlrmr�splitextr�rUrorr�rsrrqr�r�r�rr�rrrr�r�r�r��tempfileZ
gettempprefixr�r�r�r��	Exception�removeZis_identical�rename�OSError�shutilr�r�Zwarning�allr]r)r6Zcheck_statusrurWrvrSrx�templater�ryr{ZtmpnameZtmpfileZorigfileZoriginal_catalogZnewfileZupdated_catalogZ
up_to_dater$r$r%ras�
��
�&�.*.�
���*
((


zupdate_catalog.runNr�r$r$r$r%r��s"r�c@s\eZdZdZde��Zddddd�Zeee	e
d�ZdZdd	d
�Z
dd�Zd
d�Zdd�ZdS)�CommandLineInterfacez%%prog %s [options] %sz%prog z$compile message catalogs to MO filesz:extract messages from source files and generate a POT filez+create new message catalogs from a POT filez0update existing message catalogs from a POT file)�compile�extract�initr�Nc
Csl|durtj}tj|jd|jd�|_|j��|j|j_	|jj
ddddd�|jj
dd	d
dtjdd
�|jj
ddd
dtj
dd
�|jjdtjd�|j�|dd��\}}|�|j�|j�rt��}tdd�|D��d}t|�D]*}t�|�}t|d|���d|j���q�dS|�s(|j�d�|d}||jv�rP|j�d|�d��|�||dd��}	|	��S)N)�commandz[args])�usager�z--list-locales�list_locales�
store_truez print all known locales and exit)�dest�actionr5z-vz	--verbose�store_const�loglevelzprint as much as possible)rr�constr5z-qz--quietzprint as little as possibleF)rrr[css|]}t|�VqdSr�r^)r"�
identifierr$r$r%r&�r'z+CommandLineInterface.run.<locals>.<genexpr>�<� rzQno valid command or option passed. Try the -h/--help option for more information.zunknown command "r�) �sys�argv�optparse�OptionParserrr��parserZdisable_interspersed_args�_help�
print_help�
add_option�logging�DEBUGZERROR�set_defaults�INFO�
parse_args�_configure_loggingrrrZlocale_identifiers�max�sortedrr��printZenglish_namer_�commands�_configure_commandra)
r6rr��argsZidentifiersZid_widthrrW�cmdname�cmdinstr$r$r%ra�sH�


���
zCommandLineInterface.runcCs^t|_|j�|�|jjr(|jjd}nt��}|j�|�|�|�t�d�}|�|�dS)Nrz%(message)s)rZsetLevel�handlersrZ
StreamHandlerZ
addHandlerZ	FormatterZsetFormatter)r6rZhandler�	formatterr$r$r%r�s

z'CommandLineInterface._configure_loggingcCslt|j���td�tdtdd�|jD��d�}t|j���D]$\}}td|d|���d|���qBdS)	Nz	commands:�css|]}t|�VqdSrr
)r"rr$r$r%r&�r'z-CommandLineInterface._help.<locals>.<genexpr>r[z  rr
)rr�format_helprrrr�)r6Z	cmd_widthr�r|r$r$r%r�s
zCommandLineInterface._helpc
Cs�|j|}|�}|jr|j|_|��tj|j|df|j|d�}t|dd�}|jD]�\}}}	|�	d�}
t||
�
dd��}d|
��g}|r�|�d|���|�|j
�|
d��|j�|
d�}
|
|kr�|jd	|
�d
�7_qV|
|jvr�|j|d|	d��qV|
|jv�r|j|d
|	|
d��qV|j||	||
d��qV|�|�\}}|�r\t||�
dd�|�t|���D]\}}t|||��qhz|��Wn4t�y�}z|�t|��WYd}~n
d}~00|S)Nr�)rr|r<r$�=�-�_z--r�>r)rr5rh)rr5�choices)r5�defaultr,)�command_classesrr2rrrrr�r}r!�replacerhr+r?�getr@r>rr=r�setattr�varsr�Zensure_finalizedrr_r-)r6r"rZcmdclassr#rr<ZlongZshortr5r�r-Zstrsr,r�r!�keyr��errr$r$r%r �sF
�

$z'CommandLineInterface._configure_command)N)r9r:r;r�VERSIONr�rrBr�r�r�r.rrarrr r$r$r$r%r�{s"
��
.r�cCst��tj�Sr)r�rarrr$r$r$r%�main	sr6c
Cs�i}g}i}t�}t|j�|_|�||�|��D]V}|dkrNt|�|��}q2dd�|�dd�D�\}}|�||f�t|�|��||<q2|r�t	|�D](\}	\}}||vr�||}||f||	<q�||fS)N�
extractorscss|]}|��VqdSrr )r"�partr$r$r%r&Jr'z parse_mapping.<locals>.<genexpr>�:r[)
rrZ	_sectionsZ	read_fileZsectionsr�r�rrhrn)
r�r�r7r�r�r�sectionr�r�rwr$r$r%r�
s$1r�r$)�stringscCs�i}|D]�}d|vr$|�d�\}}n
|d}}||vr|r�g}|�d�D]:}|ddkrt|�t|dd��df�qH|�t|��qHt|�}|||<q|S)Nr9r����r�)rrhr�r*)r;r�rp�funcname�indicesZinds�xr$r$r%r�Ws

r��__main__)N)N)r$)Fr�r~rrrir�r�rr��collectionsrZconfigparserr�ior�typingrrrrrr5Z
babel.corer	Zbabel.messages.catalogr
rZbabel.messages.extractrr
rrZbabel.messages.mofilerZbabel.messages.pofilerrZ
babel.utilrZ	getLoggerrZ
setuptoolsrZ_CommandrAZsetuptools.errorsrrr�ImportErrorr��	distutilsZ
distutils.cmdZdistutils.errorsrrrr,rBr�r�r�r�r�r�r6r�r-r�r9r$r$r$r%�<module>sj

*)YU
J


Youez - 2016 - github.com/yon3zu
LinuXploit