o
    V\I                     @   s  d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZ ddlmZ ddlmZ ddlmZ ddlmZmZ dd	lmZmZmZmZ dd
lmZ ddlmZ ddlmZmZm Z m!Z! ddl"m#Z# ddl$m%Z%m&Z& ddl'm(Z( ddl)m*Z+ ddl,m-Z. ddl/m0Z0m1Z1 zddl2m3Z3 W n e4y   ddl5m3Z3 Y nw erdndZ6d-ddZ7G dd de.Z-G dd de-Z8G dd de-Z9dd Z:G d d! d!e-Z;G d"d# d#e-Z<G d$d% d%e=Z>d&d' Z?d-d(d)Z@g fd*d+ZAeBd,kre?  dS dS ).z
    babel.messages.frontend
    ~~~~~~~~~~~~~~~~~~~~~~~

    Frontends for the message extraction functionality.

    :copyright: (c) 2013-2019 by the Babel Team.
    :license: BSD, see LICENSE for more details.
    )print_functionN)OrderedDict)datetime)getpreferredencoding)__version__)Locale
localedata)StringIOstring_types	text_typePY2)UnknownLocaleError)Catalog)DEFAULT_KEYWORDSDEFAULT_MAPPINGcheck_and_call_extract_fileextract_from_dir)write_mo)read_powrite_po)LOCALTZ)log)Command)DistutilsOptionErrorDistutilsSetupError)RawConfigParserrUrc                 C   s   g }t | ttfs| g} | D ]'}|du rqt |ttfr&|t||d q|dd t||D  qtdd |D sAJ |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splitc                 s   s    | ]}|  V  qd S Nstrip).0s r%   9/usr/lib/python3/dist-packages/babel/messages/frontend.py	<genexpr>S   s    z listify_value.<locals>.<genexpr>c                 s   s    | ]}t |tV  qd S r    )
isinstancer
   )r#   valr%   r%   r&   r'   T   s    )r(   listtupleextendlistify_valuer   r   all)argr   outr)   r%   r%   r&   r-   .   s    r-   c                   @   s.   e Zd ZdZdZdZi Zi ZeZ	dddZ
dS )r   Nr%   c                 C   s0   || _ |   d | _d| _d | _d| _d| _d S )NFr   )distributioninitialize_options_dry_runverboseforcehelp	finalized)selfdistr%   r%   r&   __init__v   s   
zCommand.__init__r    )__name__
__module____qualname__as_argsmultiple_value_optionsboolean_optionsoption_aliasesoption_choicesdistutils_logr   r:   r%   r%   r%   r&   r   X   s    r   c                   @   sD   e Zd ZdZdZg dZddgZdd Zdd	 Zd
d Z	dd Z
dS )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=Dz>domains of PO files (space separated list, default 'messages'))z
directory=d.path to base directory containing the catalogszinput-file=izname 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fzalso include fuzzy translations)
statisticsNz#print statistics about translationsrP   rR   c                 C   s.   d| _ d | _d | _d | _d | _d| _d| _d S NmessagesF)domain	directory
input_fileoutput_filelocale	use_fuzzyrR   r8   r%   r%   r&   r2         
z"compile_catalog.initialize_optionsc                 C   s<   t | j| _| js| jstd| js| jstdd S 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-   rU   rW   rV   r   rX   r[   r%   r%   r&   finalize_options   s   z compile_catalog.finalize_optionsc                 C   sT   d}| j D ]}| | D ]
\}}|t|7 }qq|r$| jd|  |r(dS dS )Nr   z%d errors encountered.   )rU   _run_domainitemslenr   error)r8   n_errorsrU   catalogerrorsr%   r%   r&   run   s   
zcompile_catalog.runc              
   C   sx  g }g }| j s`| jr.|| jtj| j| jd|d f |tj| j| jd|d  nUt| jD ]*}tj| j|d|d }tj|r^|||f |tj| j|d|d  q4n#|| j| j f | j	rs|| j	 n|tj| j| jd|d  |st
di }t|D ]\}\}}|| }t|d}	t|	|}
W d    n1 sw   Y  | jrd}t|
dd  D ]	}|jr|d7 }qd}t|
r|d t|
 }| jd	|t|
|| |
jr| js| jd
| qt|
  ||
< }|D ]\}}|D ]}| jd||j| qq| jd|| t|d}t||
| jd W d    n	1 s4w   Y  q|S )NLC_MESSAGES.poz.mono message catalogs foundrbr   r^   d   z)%d of %d messages (%d%%) translated in %sz'catalog %s is marked as fuzzy, skippingzerror: %s:%d: %szcompiling catalog %s to %swb)rZ   )rW   rY   appendospathjoinrV   listdirexistsrX   r   	enumerateopenr   rR   r*   stringra   r   infofuzzyrZ   checkrb   linenor   )r8   rU   po_filesmo_filesrY   po_filecatalogs_and_errorsidxmo_fileinfilerd   
translatedmessage
percentagecatalog_errorsre   rb   outfiler%   r%   r&   r_      s   	
zcompile_catalog._run_domainN)r;   r<   r=   __doc__descriptionuser_optionsr@   r2   r]   rf   r_   r%   r%   r%   r&   rD      s    			rD   c                   @   sb   e Zd ZdZdZg dZg dZdZdZddd	d
dZ	ddiZ
dd Zdd Zdd Zdd ZdS )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))zcharset=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=Nzlocation 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)rK   rL   zname of the output filezwidth=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))zmsgid-bugs-address=Nzset report address for msgid)zcopyright-holder=Nzset copyright holder in output)zproject=Nzset project name in output)zversion=Nzset 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(,))zinput-dirs=Nz@alias for input-paths (does allow files as well as directories).)r   r   r   r   r   r   r   zinput-paths)zadd-commentskeywords)z	--keyword)z	--mapping)z--output)z--strip-comment-tags)r   zmapping-filezoutput-filer   zadd-location)fullfileneverc                 C   s   d| _ d | _d| _d | _d| _d | _d| _d | _d | _d | _	d | _
d| _d| _d| _d | _d | _d | _d | _d | _d| _d| _d S )Nzutf-8FT)charsetr   no_default_keywordsmapping_fileno_locationadd_locationomit_headerrX   
input_dirsinput_pathswidthno_wrapsort_outputsort_by_filemsgid_bugs_addresscopyright_holderprojectversionadd_commentsstrip_commentsinclude_linenor[   r%   r%   r&   r2   [  s*   
z#extract_messages.initialize_optionsc                 C   s  | j r| js| j | _ntd| jri }nt }|tt| j	 || _	| j	s-td| j
s4td| jr>| jr>td| jsH| jsHd| _n| jd urSt| j| _| jr]| jr]td| jrot| jtrntd| j| _n| jd urtdd	 | jjp~d
D  | _ng | _| jstd| jD ]}tj|std| qt| jpd
d| _| jr| js| j | _| js| j  | _| j!dkrd| _"d S | j!dkrd| _#d S d S )Nz1input-dirs and input-paths are mutually exclusivez=you must specify new keywords if you disable the default oneszno output file specified0'--no-wrap' and '--width' are mutually exclusiveL   z;'--sort-output' and '--sort-by-file' are mutually exclusivez,\s*c                 S   s   g | ]
}| d dd qS ).r^   r   r   )r#   r   r%   r%   r&   
<listcomp>  s    z5extract_messages.finalize_options.<locals>.<listcomp>r%   z'no input files or directories specifiedzInput path: %s does not exist,r   Tr   F)$r   r   r   r   r   copyupdateparse_keywordsr-   r   rX   r   r   intr   r   r(   r
   rer   r1   dictfromkeyspackageskeysrn   ro   rr   r   r   get_namer   get_versionr   r   r   )r8   r   ro   r%   r%   r&   r]   r  sf   









z!extract_messages.finalize_optionsc                    sL    }tjd}tjjjjjd}|D ]^\ }} fdd}t	j
 r@t	 }t |||jjj|}nt ||jj|jd}|D ](\}	}
}}}t	j
 r`|	}nt	j
t	j
 |	}|j|d ||
fg||d qPqjdj t||jjjjjjd W d    d S 1 sw   Y  d S )	Nrl   )r   r   r   r   r   c                    sl   |dkrd S t j r }nt jt j | }d}|r,dddd | D  }jd|| d S )Nignore z (%s)z, c                 S   s   g | ]
\}}d ||f qS )z%s="%s"r%   )r#   r   vr%   r%   r&   r     s    z:extract_messages.run.<locals>.callback.<locals>.<listcomp>zextracting messages from %s%s)rn   ro   isfilenormpathrp   r`   r   rv   )filenamemethodoptionsfilepathoptstrro   r8   r%   r&   callback  s   
z&extract_messages.run.<locals>.callback)r   comment_tagsr   strip_comment_tags)auto_commentscontextzwriting PO template file to %s)r   r   r   r   r   r   )_get_mappingsrt   rX   r   r   r   r   r   r   rn   ro   r   getcwdr   r   r   r   r   r   rp   addr   rv   r   r   r   r   r   r   r   )r8   mappingsr   rd   
method_mapoptions_mapr   current_dir	extractedr   ry   r   commentsr   r   r%   r   r&   rf     sR   
	
"zextract_messages.runc                 C   s  g }| j r1t| j t}t|\}}W d    n1 sw   Y  | jD ]
}||||f q$|S t| jdd rw| jj}|	 D ]4\}}t
|trRtt|\}}ng i }}|D ]\}}	}
|||	f |
phi ||< qY||||f q@|S | jD ]
}||ti f qz|S )Nmessage_extractors)r   rt   po_file_read_modeparse_mappingr   rm   getattrr1   r   r`   r(   r
   r	   r   )r8   r   fileobjr   r   ro   r   mappingpatternr   r   r%   r%   r&   r     s,   



zextract_messages._get_mappingsN)r;   r<   r=   r   r   r   r@   r>   r?   rA   rB   r2   r]   rf   r   r%   r%   r%   r&   r   
  s$    1C=r   c                 C   s"   |dksJ t |tstddS )ag  Validate 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   )r9   namevaluer%   r%   r&   check_message_extractors  s   	
r   c                   @   s:   e Zd ZdZdZg dZdgZdd Zdd Zd	d
 Z	dS )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)rE   rF   z&domain of PO file (default 'messages')rI   )output-dir=rG   zpath to output directoryrK   rL   zQname of the output file (default '<output_dir>/<locale>/LC_MESSAGES/<domain>.po'))rN   rO   z$locale for the new localized catalogr   r   r   c                 C   s.   d | _ d | _d | _d | _d| _d| _d | _d S rS   )
output_dirrX   rW   rY   rU   r   r   r[   r%   r%   r&   r2   A  r\   zinit_catalog.initialize_optionsc              
   C   s   | j std| jstdz	t| j| _W n ty' } zt|d }~ww | js2| js2td| jsDt	j
| j| jd| jd | _t	j
t	j
| jsYt	t	j
| j | jrc| jrctd| jsn| jsnd| _d S | jd ur{t| j| _d S d S )Nyou must specify the input filez-you must provide a locale for the new catalogz%you must specify the output directoryrg   rh   r   r   )rW   r   rY   r   parse_localer   rX   r   rn   ro   rp   rU   rr   dirnamemakedirsr   r   r   )r8   er%   r%   r&   r]   J  s2   


zinit_catalog.finalize_optionsc                 C   s   | j d| j| j t| jd}t|| jd}W d    n1 s"w   Y  | j|_t	t
|_d|_t| jd}t||| jd W d    d S 1 sNw   Y  d S )Nzcreating catalog %s based on %srj   )rY   Frl   )r   )r   rv   rX   rW   rt   r   rY   r   r   nowr   revision_daterw   r   r   )r8   r   rd   r   r%   r%   r&   rf   f  s   
"zinit_catalog.runN
r;   r<   r=   r   r   r   r@   r2   r]   rf   r%   r%   r%   r&   r     s    	r   c                   @   s<   e Zd ZdZdZg dZg dZdd Zdd Zd	d
 Z	dS )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)r   rI   )r   rG   rH   r   )r   Nz%do not include msgid  entry in headerrM   r   r   )zignore-obsolete=Nz1whether to omit obsolete messages from the output)no-fuzzy-matchingNzdo not use fuzzy matching)update-header-commentNzupdate target header comment)previousNz+keep previous msgids of translated messages)r   r   zignore-obsoleter   r   r   c                 C   sL   d| _ d | _d | _d | _d| _d | _d | _d| _d| _d| _	d| _
d| _d S rS   )rU   rW   r   rX   r   rY   r   r   ignore_obsoleteno_fuzzy_matchingupdate_header_commentr   r[   r%   r%   r&   r2     s   
z!update_catalog.initialize_optionsc                 C   s   | j std| js| jstd| jr| jstd| jr%| jr%td| js/| js/d| _n| jd ur:t| j| _| jrE| j	rGd| _	d S d S d S )Nr   z-you must specify the output file or directoryzyou must specify the localer   r   F)
rW   r   rX   r   rY   r   r   r   r   r   r[   r%   r%   r&   r]     s   

zupdate_catalog.finalize_optionsc              
   C   s0  g }| j sA| jr|| jtj| j| jd| jd f n-t| jD ]}tj| j|d| jd }tj	|r?|||f q#n	|| j| j f |sPt
d| j}|sbtjtj| jd }t| jd}t|}W d    n1 sww   Y  |D ]\}}| jd|| j t|d}t|||d}W d    n1 sw   Y  |j|| j| jd tjtj|t tj| }	z%t|	d	}
t|
|| j| j| j| jd
 W d    n1 sw   Y  W n	   t|	  zt|	| W q~ ty   t| t !|	| t|	 Y q~w d S )Nrg   rh   ri   r   rj   zupdating catalog %s based on %s)rY   rU   )r   rl   )r   r   include_previousr   )"rX   rY   rm   rn   ro   rp   r   rU   rq   rr   r   splitextbasenamerW   rt   r   r   rv   r   r   r   r   tempfilegettempprefixr   r   r   r   r   removerenameOSErrorshutilr   )r8   rz   rY   r|   rU   r   templater   rd   tmpnametmpfiler%   r%   r&   rf     sz   



zupdate_catalog.runNr   r%   r%   r%   r&   r   x  s    r   c                   @   s^   e Zd ZdZdZde ZdddddZee	e
edZd	Zdd
dZdd Zdd Zdd Zd	S )CommandLineInterfacezCommand-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extractinitr   Nc                 C   s~  |du rt j}tj| jd | jd| _| j  | j| j_	| jj
ddddd | jj
d	d
ddtjdd | jj
ddddtjdd | jjdtjd | j|dd \}}| |j |jrt }tdd |D }|  d|d  }|D ]}t|}|||jf }	t|	t jjpt pdd qxdS |s| j d |d }
|
| j!vr| j d|
  | "|
|dd }|# 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actionr6   z-vz	--verbosestore_constloglevelzprint as much as possible)r  r  constr6   z-qz--quietzprint as little as possibleF)r	  r  r^   c                 S      g | ]}t |qS r%   ra   )r#   
identifierr%   r%   r&   r   A      z,CommandLineInterface.run.<locals>.<listcomp>z
%%-%ds %%sasciireplacer   zQno valid command or option passed. Try the -h/--help option for more information.zunknown command "%s")$sysargvoptparseOptionParserr  r   parserdisable_interspersed_args_help
print_help
add_optionloggingDEBUGERRORset_defaultsINFO
parse_args_configure_loggingr  r	  r   locale_identifiersmaxsortr   r   english_nameprintencodestdoutencodingr   rb   commands_configure_commandrf   )r8   r  r   argsidentifierslongestformatr  rY   outputcmdnamecmdinstr%   r%   r&   rf   $  sV   




zCommandLineInterface.runc                 C   sd   t d| _| j| | jjr| jjd }n
t  }| j| || t d}|| d S )Nbabelr   z%(message)s)	r  	getLoggerr   setLevelhandlersStreamHandler
addHandler	FormattersetFormatter)r8   r  handler	formatterr%   r%   r&   r%  W  s   

z'CommandLineInterface._configure_loggingc                 C   sl   t | j  t d tdd | jD }dtd|d  }t| j }|D ]\}}t |||f  q'd S )Nz	commands:c                 S   r  r%   r  )r#   r  r%   r%   r&   r   i  r  z.CommandLineInterface._help.<locals>.<listcomp>z  %%-%ds %%s   r^   )r*  r  format_helpr'  r.  sortedr`   )r8   r2  r3  r.  r   r   r%   r%   r&   r  f  s   zCommandLineInterface._helpc              
   C   s  | j | }| }| jr| j|_t|tsJ |  tj| j|df | j| d}t	|dd}|j
D ]i\}}}	|d}
t	||
dd}d|
 g}|rS|d	|  ||j|
d |j|
d
}|
|krr| jd|
 7  _q2|
|jv r|j|d|	d q2|
|jv r|j|d|	|d q2|j||	||d q2||\}}|rt||dd| t| D ]
\}}t||| qz|  W |S  ty } z|t| W Y d
}~|S d
}~ww )zB
        :type cmdname: str
        :type argv: list[str]
        r   )r  r   r>   r%   =-_z--%sz-%sNz<%s>r
  )r  r6   rm   )r  r6   choices)r6   defaultrG  )command_classesr   r(   r   r2   r  r  r  r.  r   r   r"   r  rm   r,   rA   getrB   r@   r  r?   r$  setattrvarsr`   ensure_finalizedr   rb   str)r8   r5  r  cmdclassr6  r  r>   longshortr6   r   rH  strsrG  r   r0  keyr   errr%   r%   r&   r/  o  sN   





z'CommandLineInterface._configure_commandr    )r;   r<   r=   r   r  VERSIONr   r.  rD   r   r   r   rI  r   rf   r%  r  r/  r%   r%   r%   r&   r    s&    
3	r  c                   C   s   t  tjS r    )r  rf   r  r  r%   r%   r%   r&   main  s   rV  c           
      C   s   i }g }i }t  }t|j|_tr|| | n|| | | D ]+}|dkr0t||}q"dd |	ddD \}}|
||f t||||< q"|rit|D ]\}	\}}||v rb|| }||f||	< qT||fS )a  Parse 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`
    
extractorsc                 S   s   g | ]}|  qS r%   r!   )r#   partr%   r%   r&   r     r  z!parse_mapping.<locals>.<listcomp>:r^   )r   r   	_sectionsr   readfp	read_filesectionsr   r`   r   rm   rs   )
r   r   rW  r   r   r  sectionr   r   r~   r%   r%   r&   r     s(   1r   c                 C   s   i }| D ]F}d|v r| d\}}n|d}}||vrJ|rFg }| dD ]}|d dkr:|t|dd df q$|t| q$t|}|||< q|S )aQ  Parse 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))
    rY  Nr   r   )r   rm   r   r+   )stringsr   ru   funcnameindicesindsxr%   r%   r&   r     s    
r   __main__r    )Cr   
__future__r   r  r  rn   r   r   r  r   collectionsr   r   rY   r   r7  r   rU  r   r   babel._compatr	   r
   r   r   
babel.corer   babel.messages.catalogr   babel.messages.extractr   r   r   r   babel.messages.mofiler   babel.messages.pofiler   r   
babel.utilr   	distutilsr   rC   distutils.cmdr   _Commanddistutils.errorsr   r   ConfigParserr   ImportErrorconfigparserr   r-   rD   r   r   r   r   objectr  rV  r   r   r;   r%   r%   r%   r&   <module>   sb   	
*) 
  [  
N
