%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/babel/messages/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/babel/messages/__pycache__/frontend.cpython-37.pyc

B

H��XU��@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
m
Z
ddlmZddl
mZddl
mZmZddlmZmZmZdd	lmZdd
lmZddlmZmZmZmZddlm Z dd
l!m"Z"m#Z#ddl$m%Z%m&Z&ddl'm(Z)ddl*m+Z,ddl-m.Z.m/Z/yddl0m1Z1Wn"e2k
�rFddl3m1Z1YnXd*dd�Z4Gdd�de,�Z+Gdd�de+�Z5Gdd�de+�Z6dd�Z7Gdd�de+�Z8Gdd �d e+�Z9Gd!d"�d"e:�Z;d#d$�Z<d+d%d&�Z=gfd'd(�Z>e?d)k�r�e<�dS),z�
    babel.messages.frontend
    ~~~~~~~~~~~~~~~~~~~~~~~

    Frontends for the message extraction functionality.

    :copyright: (c) 2013 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�)�print_functionN)�datetime)�getpreferredencoding)�__version__)�Locale�
localedata)�StringIO�string_types�	text_type)�UnknownLocaleError)�Catalog)�DEFAULT_KEYWORDS�DEFAULT_MAPPING�check_and_call_extract_file�extract_from_dir)�write_mo)�read_po�write_po)�LOCALTZ�odict)�log)�Command)�DistutilsOptionError�DistutilsSetupError)�RawConfigParsercCs�g}t|ttf�s|g}xV|D]N}|dkr,qt|ttf�rN|�t||d��q|�dd�t|��|�D��qWtdd�|D��s�t�|S)a
    Make a list out of an argument.

    Values from `distutils` argument parsing are always single strings;
    values from `optparse` parsing may be lists of strings that may need
    to be further split.

    No matter the input, this function returns a flat list of whitespace-trimmed
    strings, with `None` values filtered out.

    >>> listify_value("foo bar")
    ['foo', 'bar']
    >>> listify_value(["foo bar"])
    ['foo', 'bar']
    >>> listify_value([["foo"], "bar"])
    ['foo', 'bar']
    >>> listify_value([["foo"], ["bar", None, "foo"]])
    ['foo', 'bar', 'foo']
    >>> listify_value("foo, bar, quux", ",")
    ['foo', 'bar', 'quux']

    :param arg: A string or a list of strings
    :param split: The argument to pass to `str.split()`.
    :return:
    N)�splitcss|]}|��VqdS)N)�strip)�.0�s�r�H/opt/alt/python37/lib/python3.7/site-packages/babel/messages/frontend.py�	<genexpr>Osz listify_value.<locals>.<genexpr>css|]}t|t�VqdS)N)�
isinstancer	)r�valrrr r!Ps)	r"�list�tuple�extend�
listify_valuer
r�all�AssertionError)�argr�outr#rrr r'*s
"r'c@s.eZdZdZdZdZiZiZeZ	ddd�Z
dS)rNrcCs0||_|��d|_d|_d|_d|_d|_dS)NFr)�distribution�initialize_optionsZ_dry_run�verbose�force�helpZ	finalized)�self�distrrr �__init__rszCommand.__init__)N)�__name__�
__module__�__qualname__�as_args�multiple_value_options�boolean_options�option_aliases�option_choices�
distutils_logrr3rrrr rTsrc@sNeZdZdZdZddddddd	gZd
dgZdd
�Zdd�Zdd�Z	dd�Z
dS)�compile_cataloga�Catalog compilation command for use in ``setup.py`` scripts.

    If correctly installed, this command is available to Setuptools-using
    setup scripts automatically. For projects using plain old ``distutils``,
    the command needs to be registered explicitly in ``setup.py``::

        from babel.messages.frontend import compile_catalog

        setup(
            ...
            cmdclass = {'compile_catalog': compile_catalog}
        )

    .. versionadded:: 0.9
    z+compile message catalogs to binary MO files)zdomain=�Dz>domains of PO files (space separated list, default 'messages'))z
directory=�dz.path to base directory containing the catalogs)zinput-file=�izname of the input file)zoutput-file=�ozQname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.mo'))zlocale=�lz locale of the catalog to compile)z	use-fuzzy�fzalso include fuzzy translations)�
statisticsNz#print statistics about translationsz	use-fuzzyrDcCs.d|_d|_d|_d|_d|_d|_d|_dS)N�messagesF)�domain�	directory�
input_file�output_file�locale�	use_fuzzyrD)r1rrr r-�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'rFrHrGrrI)r1rrr �finalize_options�s
z compile_catalog.finalize_optionscCsx|jD]}|�|�qWdS)N)rF�_run_domain)r1rFrrr �run�szcompile_catalog.runc
Csfg}g}|js�|jr\|�|jtj�|j|jd|d�f�|�tj�|j|jd|d��nfx�t�|j�D]T}tj�|j|d|d�}tj�|�rj|�||f�|�tj�|j|d|d��qjWnF|�|j|jf�|j	r�|�|j	�n |�tj�|j|jd|d��|�st
d���xFt|�D�]8\}\}}||}t|d��}t
||�}	WdQRX|j�r�d}
x*t|	�dd�D]}|j�rx|
d7}
�qxWd}t|	��r�|
dt|	�}|j�d	|
t|	�||�|	j�r�|j�s�|j�d
|��q$x:|	��D].\}}
x"|
D]}|j�d||j|��qW�q�W|j�d||�t|d
��}t||	|jd�WdQRX�q$WdS)N�LC_MESSAGESz.poz.mozno message catalogs found�rbr��dz)%d of %d messages (%d%%) translated in %sz'catalog %s is marked as fuzzy, skippingzerror: %s:%d: %szcompiling catalog %s to %s�wb)rK)rHrJ�append�os�path�joinrG�listdir�existsrIr�	enumerate�openrrDr$�string�lenr�info�fuzzyrKZcheck�error�linenor)r1rF�po_filesZmo_filesrJ�po_file�idxZmo_file�infile�catalogZ
translated�messageZ
percentage�errorsr`�outfilerrr rM�sh

zcompile_catalog._run_domainN)r4r5r6�__doc__�description�user_optionsr9r-rLrNrMrrrr r=}s		r=c@s�eZdZdZdZddddddd	d
ddd
dddddddddgZdddddddgZdZdZd d!d"d#d$�Z	d%d&iZ
d'd(�Zd)d*�Zd+d,�Z
d-d.�Zd/S)0�extract_messagesa�Message extraction command for use in ``setup.py`` scripts.

    If correctly installed, this command is available to Setuptools-using
    setup scripts automatically. For projects using plain old ``distutils``,
    the command needs to be registered explicitly in ``setup.py``::

        from babel.messages.frontend import extract_messages

        setup(
            ...
            cmdclass = {'extract_messages': extract_messages}
        )
    z1extract 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))zno-default-keywordsNz#do not include the default keywords)z
mapping-file=�Fz&path to the mapping configuration file)zno-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).)zomit-headerNz'do not include msgid "" entry in header)zoutput-file=rAzname of the output file)zwidth=�wz"set output line width (default 76))zno-wrapNzVdo not break long message lines, longer than the output line width, into several lines)zsort-outputNz&generate sorted output (default False))z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(,))zstrip-commentsrz)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).zno-default-keywordszno-locationzomit-headerzno-wrapzsort-outputzsort-by-filezstrip-commentszinput-paths)zadd-comments�keywords)z	--keyword)z	--mapping)z--output)z--strip-comment-tags)rrzmapping-filezoutput-filezstrip-commentsz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|_dS)Nzutf-8FT)�charsetrr�no_default_keywords�mapping_file�no_location�add_location�omit_headerrI�
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)r1rrr r-Ms*z#extract_messages.initialize_optionscCs�|jr|js|j|_ntd��|jr*i}nt��}|�tt|j	���||_	|j	sZtd��|j
shtd��|jr||jr|td��|js�|js�d|_n|jdk	r�t
|j�|_|jr�|jr�td��|jr�t|jt�r�t�d|j�|_n6|jdk	�rt�dd	�|jjp�d
D����|_ng|_|j�s$td��x*|jD] }tj�|��s,td|���q,Wt|j�p\d
d
�|_|j�r�|j�s�|j��|_|j�s�|j� �|_|j!dk�r�d|_"n|j!dk�r�d|_#dS)Nz1input-dirs and input-paths are mutually exclusivez=you must specify new keywords if you disable the default oneszno output file specifiedz0'--no-wrap' and '--width' are mutually exclusive�Lz;'--sort-output' and '--sort-by-file' are mutually exclusivez,\s*cSsg|]}|�dd�d�qS)�.rQr)r)rrnrrr �
<listcomp>�sz5extract_messages.finalize_options.<locals>.<listcomp>rz'no input files or directories specifiedzInput path: %s does not exist�,rtTrsF)$r{r|rrvr
�copy�update�parse_keywordsr'rrrIr~r}�intrr�r"r	�rerr,�dict�fromkeysZpackages�keysrUrVrYr�r�Zget_namer�Zget_versionryrxr�)r1rrrVrrr rLdsZ

z!extract_messages.finalize_optionscs@���}t�jd��� }t�j�j�j�j�jd�}x�|D]�\�}}��fdd�}t	j
���r�t	��}t
�|||�j�j�j|�}nt�||�j�j|�jd�}xX|D]P\}	}
}}}
t	j
���r�|	}nt	j
�t	j
��|	��}|j|d||
fg||
d�q�Wq:W�j�d�j�t||�j�j�j�j�j�jd�WdQRXdS)	NrS)r�r�r�r�rucsl|dkrdStj���r�}ntj�tj��|��}d}|rXdd�dd�|��D��}�j�d||�dS)N�ignore�z (%s)z, cSsg|]\}}d||f�qS)z%s="%s"r)rrn�vrrr r��sz:extract_messages.run.<locals>.callback.<locals>.<listcomp>zextracting messages from %s%s)rUrV�isfile�normpathrW�itemsrr^)�filename�method�options�filepathZoptstr)rVr1rr �callback�sz&extract_messages.run.<locals>.callback)rrZcomment_tagsr�Zstrip_comment_tags)Z
auto_comments�contextzwriting PO template file to %s)r}rxrzrr�r�)�
_get_mappingsr[rIrr�r�r�r�rurUrVr��getcwdrrrr�r�rr�rW�addrr^rr}rxrzrr�r�)r1�mappingsrirf�
method_map�options_mapr�Zcurrent_dirZ	extractedr�rargZcommentsr�r�r)rVr1r rN�sD



zextract_messages.runc	Csg}|jrPt|jd��}t|�\}}WdQRXx�|jD]}|�|||f�q6Wn�t|jdd�r�|jj}x�|��D]l\}}t	|t
�r�tt|��\}}n8gi}}x,|D]$\}}	}
|�||	f�|
p�i||<q�W|�|||f�qpWn x|jD]}|�|tif�q�W|S)N�U�message_extractors)
rwr[�
parse_mappingr|rT�getattrr,r�r�r"r	rr)r1r��fileobjr�r�rVr��mapping�patternr�r�rrr r��s&

zextract_messages._get_mappingsN)r4r5r6rjrkrlr9r7r8r:r;r-rLrNr�rrrr rm�sF

C=rmcCs"|dkst�t|t�std��dS)agValidate the ``message_extractors`` keyword argument to ``setup()``.

    :param dist: the distutils/setuptools ``Distribution`` object
    :param name: the name of the keyword argument (should always be
                 "message_extractors")
    :param value: the value of the keyword argument
    :raise `DistutilsSetupError`: if the value is not valid
    r�zDthe value of the "message_extractors" parameter must be a dictionaryN)r)r"r�r)r2�name�valuerrr �check_message_extractorss	
r�c@sDeZdZdZdZddddddd	gZd
gZdd�Zd
d�Zdd�Z	dS)�init_cataloga�New catalog initialization command for use in ``setup.py`` scripts.

    If correctly installed, this command is available to Setuptools-using
    setup scripts automatically. For projects using plain old ``distutils``,
    the command needs to be registered explicitly in ``setup.py``::

        from babel.messages.frontend import init_catalog

        setup(
            ...
            cmdclass = {'init_catalog': init_catalog}
        )
    z(create a new catalog based on a POT file)zdomain=r>z&domain of PO file (default 'messages'))zinput-file=r@zname of the input file)zoutput-dir=r?zpath to output directory)zoutput-file=rAzQname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.po'))zlocale=rBz$locale for the new localized catalog)zwidth=rpz"set output line width (default 76))zno-wrapNzVdo not break long message lines, longer than the output line width, into several lineszno-wrapcCs.d|_d|_d|_d|_d|_d|_d|_dS)NrEF)�
output_dirrIrHrJrFr~r})r1rrr r-3szinit_catalog.initialize_optionsc
Cs�|jstd��|jstd��yt�|j�|_Wn*tk
rX}zt|��Wdd}~XYnX|jsn|jsntd��|js�t	j
�|j|jd|jd�|_t	j
�
t	j
�|j��s�t	�t	j
�|j��|jr�|jr�td��|js�|js�d|_n|jdk	r�t|j�|_dS)Nzyou must specify the input filez-you must provide a locale for the new catalogz%you must specify the output directoryrOz.poz0'--no-wrap' and '--width' are mutually exclusiver�)rHrrJr�parse�_localerrIr�rUrVrWrFrY�dirname�makedirsr~r}r�)r1�errr rL<s*
zinit_catalog.finalize_optionsc	Cs�|j�d|j|j�t|jd��}t||jd�}WdQRX|j|_t�	t
�|_d|_t|jd��}t
|||jd�WdQRXdS)Nzcreating catalog %s based on %srP)rJFrS)r})rr^rIrHr[rrJr�rZnowrZ
revision_dater_rr})r1rerfrirrr rNXszinit_catalog.runN)
r4r5r6rjrkrlr9r-rLrNrrrr r�s
	r�c@sTeZdZdZdZddddddd	d
ddd
gZdddddgZdd�Zdd�Zdd�Z	dS)�update_cataloga�Catalog merging command for use in ``setup.py`` scripts.

    If correctly installed, this command is available to Setuptools-using
    setup scripts automatically. For projects using plain old ``distutils``,
    the command needs to be registered explicitly in ``setup.py``::

        from babel.messages.frontend import update_catalog

        setup(
            ...
            cmdclass = {'update_catalog': update_catalog}
        )

    .. versionadded:: 0.9
    z'update message catalogs from a POT file)zdomain=r>z&domain of PO file (default 'messages'))zinput-file=r@zname of the input file)zoutput-dir=r?z.path to base directory containing the catalogs)zoutput-file=rAzQname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.po'))zlocale=rBz locale of the catalog to compile)zwidth=rpz"set output line width (default 76))zno-wrapNzVdo not break long message lines, longer than the output line width, into several lines)zignore-obsolete=Nz1whether to omit obsolete messages from the output)zno-fuzzy-matching�Nzdo not use fuzzy matching)zupdate-header-commentNzupdate target header comment)�previousNz+keep previous msgids of translated messageszno-wrapzignore-obsoletezno-fuzzy-matchingr�zupdate-header-commentcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)NrEF)rFrHr�rIrJr}r~�ignore_obsolete�no_fuzzy_matching�update_header_commentr�)r1rrr r-�sz!update_catalog.initialize_optionscCs�|jstd��|js"|js"td��|jr6|js6td��|jrJ|jrJtd��|js^|js^d|_n|jdk	rtt|j�|_|jr�|j	r�d|_	dS)Nzyou must specify the input filez-you must specify the output file or directoryzyou must specify the localez0'--no-wrap' and '--width' are mutually exclusiver�F)
rHrrIr�rJr~r}r�r�r�)r1rrr rL�s
zupdate_catalog.finalize_optionsc
Csg}|js�|jr:|�|jtj�|j|jd|jd�f�q�x\t�|j�D]8}tj�|j|d|jd�}tj�	|�rH|�||f�qHWn|�|j|jf�|s�t
d��|j}|s�tj�tj�|j
��d}t|j
d��}t|�}WdQRX�x|D�]\}}|j�d||j
�t|d��}t|||d�}WdQRX|j||j|jd�tj�tj�|�t��tj�|��}	y2t|	d	��}
t|
||j|j|jd
�WdQRXWnt�|	��YnXyt�|	|�Wq�tk
�r�t�|�t� |	|�t�|	�Yq�Xq�WdS)NrOz.pozno message catalogs foundrrPzupdating catalog %s based on %s)rJrF)r�rS)r�Zinclude_previousr})!rIrJrTrUrVrWr�rFrXrYr�splitext�basenamerHr[rrr^r�r�r�r��tempfileZ
gettempprefixrr�r�r}�remove�rename�OSError�shutilr�)r1rbrJrcrFre�templater�rfZtmpnameZtmpfilerrr rN�sZ


zupdate_catalog.runN)
r4r5r6rjrkrlr9r-rLrNrrrr r�js"
r�c@s^eZdZdZdZdeZddddd�Zee	e
ed�Zd	Z
dd
d�Zdd
�Zdd�Zdd�Zd	S)�CommandLineInterfacez�Command-line interface.

    This class provides a simple command-line interface to the message
    extraction and PO file generation functionality.
    z%%prog %s [options] %sz	%%prog %sz$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�extractZinitr�NcCs�|dkrtj}tj|jd|jd�|_|j��|j|j_	|jj
ddddd�|jj
d	d
ddtjd
d�|jj
ddddtj
dd�|jjdtjd�|j�|dd��\}}|�|j�|j�r:t��}tdd�|D��}|��d|d}xF|D]>}t�|�}|||jf}	t|	�tjj�p*t��p*dd��q�WdS|�sL|j� d�|d}
|
|j!k�rp|j� d|
�|�"|
|dd��}|�#�S)z{Main entry point of the command-line interface.

        :param argv: list of arguments passed on the command-line
        N)�commandz[args])�usager�z--list-locales�list_locales�
store_truez print all known locales and exit)�dest�actionr0z-vz	--verbose�store_const�loglevelzprint as much as possible)r�r��constr0z-qz--quietzprint as little as possibleF)r�r�rQcSsg|]}t|��qSr)r])r�
identifierrrr r�,sz,CommandLineInterface.run.<locals>.<listcomp>z
%%-%ds %%s�ascii�replacerzQno valid command or option passed. Try the -h/--help option for more information.zunknown command "%s")$�sys�argv�optparse�OptionParserr�r��parserZdisable_interspersed_args�_helpZ
print_help�
add_option�logging�DEBUGZERRORZset_defaults�INFO�
parse_args�_configure_loggingr�r�rZlocale_identifiers�max�sortrr�Zenglish_name�print�encode�stdout�encodingrr`�commands�_configure_commandrN)r1r�r��argsZidentifiers�longest�formatr�rJ�output�cmdname�cmdinstrrr rNsJ




zCommandLineInterface.runcCsdt�d�|_|j�|�|jjr.|jjd}nt��}|j�|�|�|�t�d�}|�|�dS)N�babelrz%(message)s)	r�Z	getLoggerrZsetLevelZhandlersZ
StreamHandlerZ
addHandlerZ	FormatterZsetFormatter)r1r�ZhandlerZ	formatterrrr r�Bs

z'CommandLineInterface._configure_loggingcCspt|j���td�tdd�|jD��}dtd|d�}t|j���}x |D]\}}t|||f�qPWdS)Nz	commands:cSsg|]}t|��qSr)r])rr�rrr r�Tsz.CommandLineInterface._help.<locals>.<listcomp>z  %%-%ds %%s�rQ)r�r�Zformat_helpr�r��sortedr�)r1r�r�r�r�rkrrr r�QszCommandLineInterface._helpc
Cs�|j|}|�}|jr|j|_t|t�s,t�|��tj|j|df|j	|d�}t
|dd�}x�|jD]�\}}}	|�d�}
t
||
�
dd��}d|
g}|r�|�d	|�|�|j�|
d��|j�|
d
�}
|
|kr�|jd|
7_qf|
|jk�r|j|d|	d
��qf|
|jk�r(|j|d|	|
d��qf|j||	||
d��qfW|�|�\}}|�rht||�
dd�|�x&t|���D]\}}t|||��qvWy|��Wn2tk
�r�}z|�t|��Wd
d
}~XYnX|S)zB
        :type cmdname: str
        :type argv: list[str]
        r�)r�rkr7r�=�-�_z--%sz-%sNz<%s>r�)r�r0rT)r�r0�choices)r0�defaultr�)�command_classesrr"rr)r-r�r�r�r�r�rlrr�rTr&r:�getr;r9r�r8r��setattr�varsr�Zensure_finalizedrr`�str)r1r�r�Zcmdclassr�r�r7ZlongZshortr0r�r�Zstrsr�r�r��keyr��errrrr r�ZsF


 z'CommandLineInterface._configure_command)N)r4r5r6rjr��VERSIONr�r�r=rmr�r�r�rrNr�r�r�rrrr r��s 
3	r�cCst��tj�S)N)r�rNr�r�rrrr �main�sr�c
Cs�i}g}i}t�}t|j�|_|�||�xb|��D]V}|dkrPt|�|��}q4dd�|�dd�D�\}}|�||f�t|�|��||<q4W|r�x4t	|�D](\}	\}}||kr�||}||f||	<q�W||fS)aParse an extraction method mapping from a file-like object.

    >>> buf = StringIO('''
    ... [extractors]
    ... custom = mypackage.module:myfunc
    ...
    ... # Python source files
    ... [python: **.py]
    ...
    ... # Genshi templates
    ... [genshi: **/templates/**.html]
    ... include_attrs =
    ... [genshi: **/templates/**.txt]
    ... template_class = genshi.template:TextTemplate
    ... encoding = latin-1
    ...
    ... # Some custom extractor
    ... [custom: **/custom/*.*]
    ... ''')

    >>> method_map, options_map = parse_mapping(buf)
    >>> len(method_map)
    4

    >>> method_map[0]
    ('**.py', 'python')
    >>> options_map['**.py']
    {}
    >>> method_map[1]
    ('**/templates/**.html', 'genshi')
    >>> options_map['**/templates/**.html']['include_attrs']
    ''
    >>> method_map[2]
    ('**/templates/**.txt', 'genshi')
    >>> options_map['**/templates/**.txt']['template_class']
    'genshi.template:TextTemplate'
    >>> options_map['**/templates/**.txt']['encoding']
    'latin-1'

    >>> method_map[3]
    ('**/custom/*.*', 'mypackage.module:myfunc')
    >>> options_map['**/custom/*.*']
    {}

    :param fileobj: a readable file-like object containing the configuration
                    text to parse
    :see: `extract_from_directory`
    �
extractorscSsg|]}|���qSr)r)r�partrrr r��sz!parse_mapping.<locals>.<listcomp>�:rQ)
rrZ	_sectionsZreadfpZsectionsr�r�rrTrZ)
r�r�r�r�r�r�Zsectionr�r�rdrrr r��s$1r�cCs�i}x�|D]�}d|kr&|�d�\}}n
|d}}||kr
|r�g}xH|�d�D]:}|ddkrx|�t|dd��df�qL|�t|��qLWt|�}|||<q
W|S)aQParse keywords specifications from the given list of strings.

    >>> kw = sorted(parse_keywords(['_', 'dgettext:2', 'dngettext:2,3', 'pgettext:1c,2']).items())
    >>> for keyword, indices in kw:
    ...     print((keyword, indices))
    ('_', None)
    ('dgettext', (2,))
    ('dngettext', (2, 3))
    ('pgettext', ((1, 'c'), 2))
    rNr����rq)rrTr�r%)Zstringsrrr\�funcname�indicesZinds�xrrr r��s

r��__main__)N)N)@rjZ
__future__rr�r�rUr�r�r�r�rrJrr�rr�rrZ
babel._compatrr	r
Z
babel.corerZbabel.messages.catalogrZbabel.messages.extractr
rrrZbabel.messages.mofilerZbabel.messages.pofilerrZ
babel.utilrrZ	distutilsrr<Z
distutils.cmdrZ_CommandZdistutils.errorsrrZConfigParserr�ImportErrorZconfigparserr'r=rmr�r�r��objectr�r�r�r�r4rrrr �<module>
sV
*)[

I


Zerion Mini Shell 1.0