Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/Tools/i18n/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/Tools/i18n/__pycache__/pygettext.cpython-33.pyc

�
��fmWc@s�yddlZejZWnek
r9dd�ZYnXed�ZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZdZ
dgadjt�ZdZed	�Zdd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zddd�Zdd�ZGdd�d�Zd d!�Ze d"kr�e�ed#�id$d%6ed&�ndS('iNcCs|S(N((us((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu<lambda>su<lambda>upygettext -- Python equivalent of xgettext(1)

Many systems (Solaris, Linux, Gnu) provide extensive tools that ease the
internationalization of C programs. Most of these tools are independent of
the programming language and can be used from within Python programs.
Martin von Loewis' work[1] helps considerably in this regard.

There's one problem though; xgettext is the program that scans source code
looking for message strings, but it groks only C (or C++). Python
introduces a few wrinkles, such as dual quoting characters, triple quoted
strings, and raw strings. xgettext understands none of this.

Enter pygettext, which uses Python's standard tokenize module to scan
Python source code, generating .pot files identical to what GNU xgettext[2]
generates for C and C++ code. From there, the standard GNU tools can be
used.

A word about marking Python strings as candidates for translation. GNU
xgettext recognizes the following keywords: gettext, dgettext, dcgettext,
and gettext_noop. But those can be a lot of text to include all over your
code. C and C++ have a trick: they use the C preprocessor. Most
internationalized C source includes a #define for gettext() to _() so that
what has to be written in the source is much less. Thus these are both
translatable strings:

    gettext("Translatable String")
    _("Translatable String")

Python of course has no preprocessor so this doesn't work so well.  Thus,
pygettext searches only for _() by default, but see the -k/--keyword flag
below for how to augment this.

 [1] http://www.python.org/workshops/1997-10/proceedings/loewis.html
 [2] http://www.gnu.org/software/gettext/gettext.html

NOTE: pygettext attempts to be option and feature compatible with GNU
xgettext where ever possible. However some options are still missing or are
not fully implemented. Also, xgettext's use of command line switches with
option arguments is broken, and in these cases, pygettext just defines
additional switches.

Usage: pygettext [options] inputfile ...

Options:

    -a
    --extract-all
        Extract all strings.

    -d name
    --default-domain=name
        Rename the default output file from messages.pot to name.pot.

    -E
    --escape
        Replace non-ASCII characters with octal escape sequences.

    -D
    --docstrings
        Extract module, class, method, and function docstrings.  These do
        not need to be wrapped in _() markers, and in fact cannot be for
        Python to consider them docstrings. (See also the -X option).

    -h
    --help
        Print this help message and exit.

    -k word
    --keyword=word
        Keywords to look for in addition to the default set, which are:
        %(DEFAULTKEYWORDS)s

        You can have multiple -k flags on the command line.

    -K
    --no-default-keywords
        Disable the default set of keywords (see above).  Any keywords
        explicitly added with the -k/--keyword option are still recognized.

    --no-location
        Do not write filename/lineno location comments.

    -n
    --add-location
        Write filename/lineno location comments indicating where each
        extracted string is found in the source.  These lines appear before
        each msgid.  The style of comments is controlled by the -S/--style
        option.  This is the default.

    -o filename
    --output=filename
        Rename the default output file from messages.pot to filename.  If
        filename is `-' then the output is sent to standard out.

    -p dir
    --output-dir=dir
        Output files will be placed in directory dir.

    -S stylename
    --style stylename
        Specify which style to use for location comments.  Two styles are
        supported:

        Solaris  # File: filename, line: line-number
        GNU      #: filename:line

        The style name is case insensitive.  GNU style is the default.

    -v
    --verbose
        Print the names of the files being processed.

    -V
    --version
        Print the version of pygettext and exit.

    -w columns
    --width=columns
        Set width of output to columns.

    -x filename
    --exclude-file=filename
        Specify a file that contains a list of strings that are not be
        extracted from the input files.  Each string to be excluded must
        appear on a line by itself in the file.

    -X filename
    --no-docstrings=filename
        Specify a file that contains a list of files (one per line) that
        should not have their docstrings extracted.  This is only useful in
        conjunction with the -D option above.

If `inputfile' is -, standard input is read.
u1.5u_u, uu�# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: %(time)s\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=%(charset)s\n"
"Content-Transfer-Encoding: %(encoding)s\n"
"Generated-By: pygettext.py %(version)s\n"

cCsGttt�dtj�|r6t|dtj�ntj|�dS(Nufile(uprintu__doc__uglobalsusysustderruexit(ucodeumsg((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyuusage�suusagecCs�|rd}tand}tadd�t|�D�ax'tdd�D]}t|�t|<qJWdttd�<d	ttd
�<dttd�<d
ttd�<dttd�<dS(Ni�icSsg|]}d|�qS(u\%03o((u.0ui((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu
<listcomp>�s	u make_escapes.<locals>.<listcomp>i iu\\u\u\tu	u\ru
u\nu
u\"u"(uescape_asciiuescapeuescape_nonasciiurangeuescapesuchruord(u
pass_nonasciiumodui((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyumake_escapes�s	umake_escapescCsdjdd�|D��S(Nucss7|]-}t|�dkr+tt|�n|VqdS(i�N(uorduescapes(u.0uc((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu	<genexpr>�suescape_ascii.<locals>.<genexpr>(ujoin(usuencoding((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyuescape_ascii�suescape_asciicCs#djdd�|j|�D��S(Nucss|]}t|VqdS(N(uescapes(u.0ub((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu	<genexpr>�su"escape_nonascii.<locals>.<genexpr>(ujoinuencode(usuencoding((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyuescape_nonascii�suescape_nonasciicCst|iid6i�S(Nu__builtins__(ueval(us((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu	safe_eval�su	safe_evalcCs�|jd�}t|�dkr;dt||�d}nw|dsa|d=|dd|d	<nx1tt|��D]}t|||�||<qtWd}d|j|�d}|S(
Nu
iu"u\n"
"u""
"i����i����i����i����(usplitulenuescapeurangeujoin(usuencodingulinesuiulineterm((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu	normalize�s
u	normalizecsd�fdd�|D�kS(u6Check whether 'str' contains ANY of the chars in 'set'icsg|]}|�k�qS(((u.0uc(ustr(u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu
<listcomp>s	ucontainsAny.<locals>.<listcomp>((ustruset((ustru9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyucontainsAnysucontainsAnycsodt�kr/dd�tj�D�dand|krK|jd�n|j�fdd�|D��dS(uHelper for getFilesForName().u_py_extcSs-g|]#}|dtjkr|d�qS(ii(uimpu	PY_SOURCE(u.0utriple((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu
<listcomp>
s	u"_visit_pyfiles.<locals>.<listcomp>iuCVScsAg|]7}tjj|�dtkrtjj�|��qS(i(uosupathusplitextu_py_extujoin(u.0ufile(udirname(u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu
<listcomp>s	N(uglobalsuimpuget_suffixesu_py_exturemoveuextend(ulistudirnameunames((udirnameu9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu_visit_pyfiless
u_visit_pyfilescCs|jdd�}t|�dkr�y6tj|d|�\}}}|rY|j�nWntk
rrdSYnX|dtjkr�t|d|g�}qd}nryWtj||�\}}}|r�|j�n|dtj	tjgkr�d}nWntk
rd}YnX|S(u�Get the filesystem path for a module or a package.

    Return the file system path to a file for a module, and to a directory for
    a package. Return None if the name is not found, or is a builtin or
    extension module.
    u.iiiN(
usplitulenuimpufind_moduleucloseuImportErroruNoneu
PKG_DIRECTORYu_get_modpkg_pathu	PY_SOURCE(udotted_nameupathlistupartsufileupathnameudescription((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu_get_modpkg_paths*
		


u_get_modpkg_pathcCs�tjj|�swt|d�r^tj|�}g}x!|D]}|jt|��q=W|St|�}|swgSntjj|�r�g}tj	|t
|�|Stjj|�r�|gSgS(u]Get a list of module files for a filename, a module or package name,
    or a directory.
    u*?[](uosupathuexistsucontainsAnyuglobuextendugetFilesForNameu_get_modpkg_pathuisdiruwalku_visit_pyfiles(unameufilesulistufile((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyugetFilesForName?s"
ugetFilesForNamecBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dddd�Zdd�Zdd�Z
dS(u
TokenEatercCsF||_i|_|j|_g|_d|_d|_d|_dS(Nii����(	u_TokenEater__optionsu_TokenEater__messagesu_TokenEater__waitingu_TokenEater__stateu_TokenEater__datau_TokenEater__linenou_TokenEater__freshmoduleuNoneu_TokenEater__curfile(uselfuoptions((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu__init__^s					uTokenEater.__init__cCs|j|||d�dS(Ni(u_TokenEater__state(uselfuttypeutstringustupuetupuline((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu__call__gsuTokenEater.__call__cCs�|j}|jr�|jj|j�r�|jr�|tjkrh|jt	|�|dd�d|_n$|tj
tjfkr�d|_ndS|tjkr�|dkr�|j
|_dSn|tjkr�||jkr�|j|_ndS(Nuisdocstringiiuclassudef(uclassudef(u_TokenEater__optionsu
docstringsunodocstringsugetu_TokenEater__curfileu_TokenEater__freshmoduleutokenizeuSTRINGu_TokenEater__addentryu	safe_evaluCOMMENTuNLuNAMEu_TokenEater__suiteseenu_TokenEater__stateukeywordsu_TokenEater__keywordseen(uselfuttypeutstringulinenouopts((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu	__waitingns		uTokenEater.__waitingcCs.|tjkr*|dkr*|j|_ndS(Nu:(utokenizeuOPu_TokenEater__suitedocstringu_TokenEater__state(uselfuttypeutstringulineno((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu__suiteseen�suTokenEater.__suiteseencCsk|tjkr:|jt|�|dd�|j|_n-|tjtjtjfkrg|j|_ndS(Nuisdocstringi(	utokenizeuSTRINGu_TokenEater__addentryu	safe_evalu_TokenEater__waitingu_TokenEater__stateuNEWLINEuINDENTuCOMMENT(uselfuttypeutstringulineno((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu__suitedocstring�suTokenEater.__suitedocstringcCsL|tjkr<|dkr<g|_||_|j|_n|j|_dS(Nu((utokenizeuOPu_TokenEater__datau_TokenEater__linenou_TokenEater__openseenu_TokenEater__stateu_TokenEater__waiting(uselfuttypeutstringulineno((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu
__keywordseen�s
		uTokenEater.__keywordseencCs�|tjkrO|dkrO|jr@|jtj|j��n|j|_n�|tjkrw|jj	t
|��nq|tjtj
tjtjtjgkr�ttd�i|d6|jd6|jd6dtj�|j|_ndS(Nu)u:*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"utokenufileulineno(utokenizeuOPu_TokenEater__datau_TokenEater__addentryuEMPTYSTRINGujoinu_TokenEater__waitingu_TokenEater__stateuSTRINGuappendu	safe_evaluCOMMENTutokenuINDENTuDEDENTuNEWLINEuNLuprintu_u_TokenEater__curfileu_TokenEater__linenousysustderr(uselfuttypeutstringulineno((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu
__openseen�s 	

uTokenEater.__openseenicCsY|dkr|j}n||jjkrU|j|f}||jj|i�|<ndS(N(uNoneu_TokenEater__linenou_TokenEater__optionsu	toexcludeu_TokenEater__curfileu_TokenEater__messagesu
setdefault(uselfumsgulinenouisdocstringuentry((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu
__addentry�s
uTokenEater.__addentrycCs||_d|_dS(Ni(u_TokenEater__curfileu_TokenEater__freshmodule(uselfufilename((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyuset_filename�s	uTokenEater.set_filenamecCs�|j}tjd�}|jr*|jnd}tti|d6td6|d6dd6d|�i}xT|jj�D]C\}}t	|j
��}|jt|�g�j
||f�qvWt	|j
��}	x�|	D]�}
||
}|j�x�|D]�\}}t|j��}t	|j
��}|js3n|j|jkr�x|D]:\}
}i|
d	6|d
6}ttd�|d|�qLWn�|j|jkrNd}x~|D]v\}
}i|
d	6|d
6}td
�|}t|�t|�|jkr||}q�t|d|�d|}q�Wt|�dkrNt|d|�qNn|rgtdd|�ntdt||�d|�tdd|�q�Wq�WdS(Nu%Y-%m-%d %H:%M+%ZuUTF-8utimeuversionucharsetu8bituencodingufileufilenameulinenou&# File: %(filename)s, line: %(lineno)du#:u %(filename)s:%(lineno)diu#, docstringumsgidu
msgstr ""
(u_TokenEater__optionsutimeustrftimeuencodinguprintu
pot_headeru__version__u_TokenEater__messagesuitemsusortedukeysu
setdefaultutupleuappendusortuanyuvaluesuwritelocationsu
locationstyleuSOLARISu_uGNUulenuwidthu	normalize(uselfufpuoptionsu	timestampuencodingureverseukuvukeysurkeysurkeyurentriesuisdocstringufilenameulinenouduloclineus((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyuwrite�sN	)


	
uTokenEater.writeN(u__name__u
__module__u__qualname__u__init__u__call__u_TokenEater__waitingu_TokenEater__suiteseenu_TokenEater__suitedocstringu_TokenEater__keywordseenu_TokenEater__openseenuNoneu_TokenEater__addentryuset_filenameuwrite(u
__locals__((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu
TokenEater]s	
u
TokenEaterc0Cs"y_tjtjdd�dddddddd	d
ddd
ddddddg�\}}Wn5tjk
r�}ztd|�WYdd}~XnXGdd�d�}|�}i|jd6|jd6}x�|D]{\}}|dFkr�td�q�|dGkrd|_q�|dHkr-|d|_q�|dIkrEd|_	q�|dJkr]d|_
q�|dKkr||jj|�q�|dLkr�ga
q�|dMkr�d|_q�|dNkr�d|_q�|dOkr|j|j��|_|jdkrOtdtd-�|�qOq�|dPkr)||_q�|dQkrA||_q�|dRkrYd|_q�|dSkr�ttd6�t�tjd�q�|dTkr�yt|�|_WqOtk
r�tdtd9�|�YqOXq�|dUkr�||_q�|dVkr�t|�}z7x0|j�}	|	s#Pnd|j|	ddW�<q
Wd|j �Xq�q�Wt!|j	�|jj"t
�|jr�y,t|j�}|j#�|_$|j �Wq�t%k
r�ttd>�|jd?tj&�tjd�Yq�Xn	g|_$g}
x=|D]5}|d@kr#|
j|�q|
j"t'|��qW|
}t(|�}xD|D]<}|d@kr�|jr�ttdA��ntj)j*}d}
n5|jr�ttdB�|�nt|dC�}d}
z�|j+|�y1t,j,|j�}x|D]}||�q�WWnht,j-k
rv}zEtdD|j.d||j.dd|j.ddfd?tj&�WYdd}~XnXWd|
r�|j �nXqSW|jd@kr�tj/}d}
nB|jr�t0j1j2|j|j�|_nt|jdE�}d}
z|j3|�Wd|
r|j �nXdS(XNiuad:DEhk:Kno:p:S:Vvw:x:X:uextract-alludefault-domain=uescapeuhelpukeyword=uno-default-keywordsuadd-locationuno-locationuoutput=uoutput-dir=ustyle=uverboseuversionuwidth=u
exclude-file=u
docstringsu
no-docstringscBsh|EeZdZdZdZdZdZgZdZdZ	dZ
eZdZdZ
dZdZiZdS(umain.<locals>.Optionsiiiuumessages.potiNN(u__name__u
__module__u__qualname__uGNUuSOLARISu
extractalluescapeukeywordsuoutpathuoutfileuwritelocationsu
locationstyleuverboseuwidthuexcludefilenameu
docstringsunodocstrings(u
__locals__((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyuOptionssuOptionsugnuusolarisu-hu--helpiu-au
--extract-allu-du--default-domainu.potu-Eu--escapeu-Du--docstringsu-ku	--keywordu-Ku--no-default-keywordsu-nu--add-locationu
--no-locationu-Su--styleuInvalid value for --style: %su-ou--outputu-pu--output-diru-vu	--verboseu-Vu	--versionu%pygettext.py (xgettext for Python) %su-wu--widthu'--width argument must be an integer: %su-xu--exclude-fileu-Xu--no-docstringsuCan't read --exclude-file: %sufileu-uReading standard inputu
Working on %surbu%s: %s, line %d, column %duw(u-hu--help(u-au
--extract-all(u-du--default-domain(u-Eu--escape(u-Du--docstrings(u-ku	--keyword(u-Ku--no-default-keywords(u-nu--add-location(u
--no-location(u-Su--style(u-ou--output(u-pu--output-dir(u-vu	--verbose(u-Vu	--version(u-wu--width(u-xu--exclude-file(u-Xu--no-docstringsi����(4ugetoptusysuargvuerroruusageuGNUuSOLARISu
extractalluoutfileuescapeu
docstringsukeywordsuappendudefault_keywordsuwritelocationsugetuloweru
locationstyleuNoneu_uoutpathuverboseuprintu__version__uexituintuwidthu
ValueErroruexcludefilenameuopenureadlineunodocstringsucloseumake_escapesuextendu	readlinesu	toexcludeuIOErrorustderrugetFilesForNameu
TokenEaterustdinubufferuset_filenameutokenizeu
TokenErroruargsustdoutuosupathujoinuwrite(uoptsuargsumsguOptionsuoptionsu	locationsuoptuargufpulineuexpandedueaterufilenameucloseputokensu_tokenue((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyumain�s� 	


	
	
	

			

0!			!umainu__main__u%*** Seen unexpected token "%(token)s"utestutokenumorethanonestring(!ufintlugettextu_uImportErroru__doc__uosuimpusysuglobutimeugetoptutokenutokenizeu__version__udefault_keywordsujoinuDEFAULTKEYWORDSuEMPTYSTRINGu
pot_headeruusageumake_escapesuescape_asciiuescape_nonasciiu	safe_evalu	normalizeucontainsAnyu_visit_pyfilesuNoneu_get_modpkg_pathugetFilesForNameu
TokenEaterumainu__name__(((u9/opt/alt/python33/lib64/python3.3/Tools/i18n/pygettext.pyu<module>sH

�			'��