403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.188.131.162
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3.6/site-packages/babel/messages/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/babel/messages/__pycache__/frontend.cpython-36.opt-1.pyc
3

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)�RawConfigParsercCstg}t|ttf�s|g}xV|D]N}|dkr,qt|ttf�rN|jt||d��q|jdd�t|�j|�D��qW|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|]}|j�VqdS)N)�strip)�.0�s�r�/usr/lib/python3.6/frontend.py�	<genexpr>Osz listify_value.<locals>.<genexpr>)�
isinstance�list�tuple�extend�
listify_valuer
r)�argr�out�valrrr r&*s
"r&c@s.eZdZdZfZfZiZiZeZ	ddd�Z
dS)rNcCs0||_|j�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_logrr1rrrr rTsrc	@sNeZdZdZdZd d!d"d#d$d%d&gZddgZdd�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�domain=�D�>domains of PO files (space separated list, default 'messages')�
directory=�d�.path to base directory containing the catalogs�input-file=�i�name of the input file�output-file=�o�Qname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.mo')�locale=�l� locale of the catalog to compile�	use-fuzzy�f�also include fuzzy translations�
statisticsN�#print statistics about translationscCs.d|_d|_d|_d|_d|_d|_d|_dS)N�messagesF)�domain�	directory�
input_file�output_file�locale�	use_fuzzyrN)r/rrr r+�sz"compile_catalog.initialize_optionscCs@t|j�|_|jr$|jr$td��|jr<|jr<td��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&rQrSrRrrT)r/rrr �finalize_options�s
z compile_catalog.finalize_optionscCsx|jD]}|j|�qWdS)N)rQ�_run_domain)r/rQrrr �run�szcompile_catalog.runcCshg}g}|js�|jr\|j|jtjj|j|jd|d�f�|jtjj|j|jd|d��nfx�tj|j�D]T}tjj|j|d|d�}tjj|�rj|j||f�|jtjj|j|d|d��qjWnF|j|j|jf�|j	r�|j|j	�n |jtjj|j|jd|d��|�st
d���xHt|�D�]:\}\}}||}t|d��}t
||�}	WdQRX|j�r�d}
x*t|	�dd�D]}|j�rx|
d7}
�qxWd}t|	��r�|
dt|	�}|jjd	|
t|	�||�|	j�r�|j�r�|jjd
|��q$x:|	j�D].\}}
x"|
D]}|jjd||j|��qW�q�W|jjd||�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)rV)rSrU�append�os�path�joinrR�listdir�existsrTr�	enumerate�openrrNr#�string�lenr�info�fuzzyrVZcheck�error�linenor)r/rQ�po_filesZmo_filesrU�po_file�idxZmo_file�infile�catalogZ
translated�messageZ
percentage�errorsrk�outfilerrr rX�sh

zcompile_catalog._run_domain)r<r=r>)r?r@rA)rBrCrD)rErFrG)rHrIrJ)rKrLrM)rNNrO)r2r3r4�__doc__�description�user_optionsr7r+rWrYrXrrrr r;}s*		r;c@s�eZdZdZdZdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYgZd	dddddd+gZd2ZdZZd[d\d]d^d9�Z	d:d_iZ
d>d?�Zd@dA�ZdBdC�Z
dDdE�ZdS)`�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�charset=N�3charset to use in the output file (default "utf-8")�	keywords=�k�ispace-separated list of keywords to look for in addition to the defaults (may be repeated multiple times)�no-default-keywords�#do not include the default keywords�
mapping-file=�F�&path to the mapping configuration file�no-location�>do not include location comments with filename and line number�
add-location=��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-header�'do not include msgid "" entry in header�output-file=rF�name of the output file�width=�w�"set output line width (default 76)�no-wrap�Vdo not break long message lines, longer than the output line width, into several lines�sort-output�&generate sorted output (default False)�sort-by-file�,sort output by file location (default False)�msgid-bugs-address=�set report address for msgid�copyright-holder=�set copyright holder in output�project=�set project name in output�version=�set project version in output�
add-comments=�c�uplace comment block with TAG (or those preceding keyword lines) in output file. Separate multiple TAGs with commas(,)�strip-commentsr�)strip the comment TAGs from the comments.�input-paths=�ofiles or directories that should be scanned for messages. Separate multiple files or directories with commas(,)�input-dirs=�@alias for input-paths (does allow files as well as directories).zinput-paths�add-comments�keywords�	--keyword�	--mapping�--output�--strip-comment-tags)r�zmapping-filezoutput-filezstrip-commentszadd-location�full�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)�charsetr��no_default_keywords�mapping_file�no_location�add_location�omit_headerrT�
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)r/rrr r+Ms*z#extract_messages.initialize_optionscCs�|jr|js|j|_ntd��|jr*i}ntj�}|jtt|j	���||_	|j	sZtd��|j
shtd��|jr||jr|td��|jr�|jr�d|_n|jdk	r�t
|j�|_|jr�|jr�td��|jr�t|jt�r�tjd|j�|_n8|jdk	�rtjdd	�|jj�pfD��j�|_ng|_|j�s*td
��x*|jD] }tjj|��s2td|���q2Wt|j�pbfd�|_|j�r�|j�s�|jj�|_|j�s�|jj �|_|j!d
k�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|]}|jdd�d�qS)�.r\r)r)rr|rrr �
<listcomp>�sz5extract_messages.finalize_options.<locals>.<listcomp>z'no input files or directories specifiedzInput path: %s does not exist�,r�Tr�F)$r�r�rr�r
�copy�update�parse_keywordsr&r�rTr�r��intr�r�r"r	�rerr*�dict�fromkeysZpackages�keysr`rardr�r�Zget_namer�Zget_versionr�r�r�)r/r�rarrr rWdsZ

z!extract_messages.finalize_optionscs@�j�}t�jd��� }t�j�j�j�j�jd�}x�|D]�\�}}��fdd�}t	j
j��r�t	j�}t
�|||�j�j�j|�}nt�||�j�j|�jd�}xX|D]P\}	}
}}}
t	j
j��r�|	}nt	j
jt	j
j�|	��}|j|d||
fg||
d�q�Wq:W�jjd�j�t||�j�j�j�j�j�jd�WdQRXdS)	Nr^)r�r�r�r�r�csl|dkrdStjj��r�}ntjjtjj�|��}d}|rXddjdd�|j�D��}�jjd||�dS)N�ignore�z (%s)z, cSsg|]\}}d||f�qS)z%s="%s"r)rr|�vrrr r��sz:extract_messages.run.<locals>.callback.<locals>.<listcomp>zextracting messages from %s%s)r`ra�isfile�normpathrb�itemsrri)�filename�method�options�filepathZoptstr)rar/rr �callback�sz&extract_messages.run.<locals>.callback)r�Zcomment_tagsr�Zstrip_comment_tags)Z
auto_comments�contextzwriting PO template file to %s)r�r�r�r�r�r�)�
_get_mappingsrfrTrr�r�r�r�r�r`rar��getcwdrr�r�r�rr�rb�addrrirr�r�r�r�r�r�)r/�mappingsrtrq�
method_map�options_mapr�Zcurrent_dirZ	extractedr�rlrrZcommentsr�r�r)rar/r rY�sD



zextract_messages.runcCsg}|jrPt|jd��}t|�\}}WdQRXx�|jD]}|j|||f�q6Wn�t|jdd�r�|jj}x�|j�D]l\}}t	|t
�r�tt|��\}}n8gi}}x,|D]$\}}	}
|j||	f�|
p�i||<q�W|j|||f�qpWn x|jD]}|j|tif�q�W|S)N�U�message_extractors)
r�rf�
parse_mappingr�r_�getattrr*r�r�r"r	rr)r/r��fileobjr�r�rar��mapping�patternr�r�rrr r��s&

zextract_messages._get_mappings)ryNrz)r{r|r})r~Nr)r�r�r�)r�Nr�)r�Nr�)r�Nr�)r�rFr�)r�r�r�)r�Nr�)r�Nr�)r�Nr�)r�Nr�)r�Nr�)r�Nr�)r�Nr�)r�r�r�)r�rr�)r�Nr�)r�Nr�)r�r�)r�)r�)r�)r�)r�r�r�)r2r3r4rurvrwr7r5r6r8r9r+rWrYr�rrrr rx�sn

C=rxcCst|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
    zDthe value of the "message_extractors" parameter must be a dictionaryN)r"r�r)r0�name�valuerrr �check_message_extractorss

r�c	@sDeZdZdZdZddd d!d"d#d$gZdgZdd�Zdd�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�domain=r=�&domain of PO file (default 'messages')�input-file=rC�name of the input file�output-dir=r@�path to output directory�output-file=rF�Qname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.po')�locale=rI�$locale for the new localized catalog�width=r��"set output line width (default 76)�no-wrapN�Vdo not break long message lines, longer than the output line width, into several linescCs.d|_d|_d|_d|_d|_d|_d|_dS)NrPF)�
output_dirrTrSrUrQr�r�)r/rrr r+3szinit_catalog.initialize_optionscCs|jstd��|jstd��ytj|j�|_Wn*tk
rX}zt|��WYdd}~XnX|jrr|jrrtd��|js�t	j
j|j|jd|jd�|_t	j
j
t	j
j|j��s�t	jt	j
j|j��|jr�|jr�td��|jr�|jr�d|_n|jdk	�rt|j�|_dS)Nzyou must specify the input filez-you must provide a locale for the new catalogz%you must specify the output directoryrZz.poz0'--no-wrap' and '--width' are mutually exclusiver�)rSrrUr�parse�_localerrTr�r`rarbrQrd�dirname�makedirsr�r�r�)r/�errr rW<s*zinit_catalog.finalize_optionscCs�|jjd|j|j�t|jd��}t||jd�}WdQRX|j|_tj	t
�|_d|_t|jd��}t
|||jd�WdQRXdS)Nzcreating catalog %s based on %sr[)rUFr^)r�)rrirTrSrfrrUr�rZnowrZ
revision_daterjrr�)r/rprqrtrrr rYXszinit_catalog.run)r�r=r�)r�rCr�)r�r@r�)r�rFr�)r�rIr�)r�r�r�)r�Nr�)
r2r3r4rurvrwr7r+rWrYrrrr r�s(
	r�c
@sTeZdZdZdZd(d)d*d+d,d-d.d/d0d1d2gZdd!dddgZd"d#�Zd$d%�Zd&d'�Z	dS)3�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�domain=r=�&domain of PO file (default 'messages')�input-file=rC�name of the input file�output-dir=r@�.path to base directory containing the catalogs�output-file=rF�Qname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.po')�locale=rI� locale of the catalog to compile�width=r��"set output line width (default 76)�no-wrapN�Vdo not break long message lines, longer than the output line width, into several lines�ignore-obsolete=�1whether to omit obsolete messages from the output�no-fuzzy-matching�N�do not use fuzzy matching�update-header-comment�update target header comment�previous�+keep previous msgids of translated messageszignore-obsoletecCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)NrPF)rQrSr�rTrUr�r��ignore_obsolete�no_fuzzy_matching�update_header_commentr)r/rrr r+�sz!update_catalog.initialize_optionscCs�|jstd��|jr&|jr&td��|jr<|jr<td��|jrP|jrPtd��|jrh|jrhd|_n|jdk	r~t|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)
rSrrTr�rUr�r�r�rr)r/rrr rW�s
zupdate_catalog.finalize_optionsc'Csg}|js�|jr:|j|jtjj|j|jd|jd�f�q�x\tj|j�D]8}tjj|j|d|jd�}tjj	|�rH|j||f�qHWn|j|j|jf�|s�t
d��|j}|s�tjjtjj|j
��d}t|j
d��}t|�}WdQRX�x|D�]\}}|jjd||j
�t|d��}t|||d�}WdQRX|j||j|jd�tjjtjj|�tj�tjj|��}	y2t|	d	��}
t|
||j|j|jd
�WdQRXWntj|	��YnXytj|	|�Wq�tk
�r�tj|�tj |	|�tj|	�Yq�Xq�WdS)NrZz.pozno message catalogs foundrr[zupdating catalog %s based on %s)rUrQ)rr^)rZinclude_previousr�)!rTrUr_r`rarbr�rQrcrdr�splitext�basenamerSrfrrrir�rrr��tempfileZ
gettempprefixrrrr��remove�rename�OSError�shutilr�)r/rmrUrnrQrp�templater�rqZtmpnameZtmpfilerrr rY�sZ


zupdate_catalog.run)r�r=r)rrCr)rr@r)rrFr)rrIr)r	r�r
)rNr)r
Nr)rrr)rNr)rNr)
r2r3r4rurvrwr7r+rWrYrrrr r�js8
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�|_|jj�|j|j_	|jj
ddddd	�|jj
d
ddd
tjdd�|jj
dddd
tj
dd�|jjdtjd�|jj|dd��\}}|j|j�|j�r:tj�}tdd�|D��}|j�d|d}xF|D]>}tj|�}|||jf}	t|	jtjj�p*t��p*dd��q�WdS|�sL|jj d�|d}
|
|j!k�rp|jj d|
�|j"|
|dd��}|j#�S)z{Main entry point of the command-line interface.

        :param argv: list of arguments passed on the command-line
        N�command�[args])�usager�z--list-locales�list_locales�
store_truez print all known locales and exit)�dest�actionr.z-vz	--verbose�store_const�loglevelzprint as much as possible)r*r)�constr.z-qz--quietzprint as little as possibleF)r'r,r\cSsg|]}t|��qSr)rh)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")r$r%)$�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�encodingrrk�commands�_configure_commandrY)r/r2r��argsZidentifiers�longest�formatr.rU�output�cmdname�cmdinstrrr rYsJ




zCommandLineInterface.runcCsdtjd�|_|jj|�|jjr.|jjd}ntj�}|jj|�|j|�tjd�}|j|�dS)N�babelrz%(message)s)	r8Z	getLoggerrZsetLevelZhandlersZ
StreamHandlerZ
addHandlerZ	FormatterZsetFormatter)r/r,ZhandlerZ	formatterrrr r<Bs

z'CommandLineInterface._configure_loggingcCspt|jj��td�tdd�|jD��}dtd|d�}t|jj��}x |D]\}}t|||f�qPWdS)Nz	commands:cSsg|]}t|��qSr)rh)rr$rrr r�Tsz.CommandLineInterface._help.<locals>.<listcomp>z  %%-%ds %%s�r\)r?r5Zformat_helpr=rC�sortedr�)r/rFrGrCr�rvrrr r6QszCommandLineInterface._helpcCs�|j|}|�}|jr|j|_|j�tj|j|df|j|d�}t|df�}x�|jD]�\}}}	|j	d�}
t||
j
dd��}d|
g}|r�|jd|�|j|j
j|
f��|jj|
d	�}
|
|kr�|jd
|
7_qX|
|jkr�|j|d|	d��qX|
|jk�r|j|d
|	|
d��qX|j||	||
d��qXW|j|�\}}|�rXt||j
dd�|�x&t|�j�D]\}}t|||��qfWy|j�Wn2tk
�r�}z|jt|��WYd	d	}~XnX|S)zB
        :type cmdname: str
        :type argv: list[str]
        r�)r&rvr5�=�-�_z--%sz-%sNz<%s>r()r*r.r_)r*r.�choices)r.�defaultrQ)�command_classesrr+r3r4r&rCr�rwrr0r_r%r8�getr9r7r7r6r;�setattr�varsr�Zensure_finalizedrrk�str)r/rIr2ZcmdclassrJr5r5ZlongZshortr.r�rRZstrsrQr�rE�keyr��errrrr rDZsD



 z'CommandLineInterface._configure_command)N)r2r3r4rur&�VERSIONr�rCr;rxr�r�rSrrYr<r6rDrrrr r!�s 
3	r!cCst�jtj�S)N)r!rYr1r2rrrr �main�sr[c
Cs�i}g}i}t�}t|j�|_|j||�xb|j�D]V}|dkrPt|j|��}q4dd�|jdd�D�\}}|j||f�t|j|��||<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|]}|j��qSr)r)r�partrrr r��sz!parse_mapping.<locals>.<listcomp>�:r\)
rrZ	_sectionsZreadfpZsectionsr�r�rr_re)
r�r�r\r�r�r5Zsectionr�r�rorrr r��s$1r�cCs�i}x�|D]�}d|kr&|jd�\}}n
|d}}||kr
|r�g}xH|jd�D]:}|ddkrx|jt|dd��df�qL|jt|��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))
    r^Nr�r\r����r_)rr_r�r$)Zstringsr�rg�funcname�indicesZinds�xrrr r��s

r��__main__)N)N)@ruZ
__future__rr8r3r`r�rr1rrrUrrKrrZrrZ
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;rxr�r�r��objectr!r[r�r�r2rrrr �<module>
sV
*)[

I


Youez - 2016 - github.com/yon3zu
LinuXploit