Current File : //opt/imh-python/lib/python2.7/gettext.pyo
�
��Wc@s�dZddlZddlZddlZddlZddlZddlZddlmZdddddd	d
ddd
dddddddgZ	ej
jejdd�Z
d�Zd�Zd�Zdd,d��YZdefd��YZdddd�ZiZdddedd�Zdeddd�Ziaiad add!�Zdd"�Zdd#�Zd$�Zd%�Z d&�Z!d'�Z"d(�Z#d)�Z$d*�Z%d+�Z&eZ'dS(-s�Internationalization and localization support.

This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.

I18N refers to the operation by which a program is made aware of multiple
languages.  L10N refers to the adaptation of your program, once
internationalized, to the local language and cultural habits.

i����N(tENOENTtNullTranslationstGNUTranslationstCatalogtfindttranslationtinstallt
textdomaintbindtextdomaintbind_textdomain_codesettdgettextt	dngettexttgettexttlgettextt	ldgettextt
ldngettextt	lngettexttngettexttsharetlocalecCs|r
|S|SdS(sy
    Implements the C expression:

      condition ? true : false

    Required to correctly interpret plural forms.
    N((t	conditionttruetfalse((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyttest?sc
syddlm}Wn!tk
r7ddlm}nXddl}ddl}|j||�j�}y@g|D]/}|d|jkrr|ddkrr|^qr}Wn|jk
r�t	d�nX|r�t	d�n|j
d	d
�}|j
dd�}tjd
���j
d|�}tjd����fd��dg}x�|D]�}|dkrr|jd�qP|dkr�t|�dkr�t	d�n�j
�|j��}	|dcd|	7<qP|dc|7<qPW�j
�|j��}td|�S(s�Gets a C expression as used in PO files for plural forms and returns a
    Python lambda function that implements an equivalent expression.
    i����(tStringIONiitns;plural forms expression error, maybe unbalanced parenthesiss*plural forms expression could be dangerouss&&s and s||s or s\!([^=])s not \1s(.*?)\?(.*?):(.*)cs8d|jd�|jd��j�|jd��fS(Nstest(%s, %s, %s)iii(tgrouptsub(tx(texprtrepl(s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRkstt(t)s%unbalanced parenthesis in plural forms(%s)slambda n: int(%s)(t	cStringIORtImportErrorttokenttokenizetgenerate_tokenstreadlinetNAMEt
TokenErrort
ValueErrortreplacetretcompileRtappendtlentpopteval(
tpluralRR$R%ttokensRtdangertstacktcts((RRs`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pytc2pyMs>
@
	
cCs�ddlm}||�}d
}d}d}d}|jd�}|dkrp||}|| }||O}nd}|jd�}|dkr�||}|| }||O}nd}|jd	�}|dkr�||}	|| }||O}nd}	|}
g}x~t|d�D]l}||@s|
}
||@rE|
|	7}
n||@r\|
|7}
n||@rs|
|7}
n|j|
�qqW|j�|S(
Ni����(t	normalizeiiit@Rt.t_iii(RR9RtrangeR.treverse(RR9tCOMPONENT_CODESETtCOMPONENT_TERRITORYtCOMPONENT_MODIFIERtmasktpostmodifiertcodesett	territorytlanguagetrettitval((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyt_expand_lang�sL















cBs�eZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zedd
�ZRS(cCsDi|_d|_d|_d|_|dk	r@|j|�ndS(N(t_infotNonet_charsett_output_charsett	_fallbackt_parse(tselftfp((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyt__init__�s				cCsdS(N((RRRS((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRQ�scCs)|jr|jj|�n	||_dS(N(RPtadd_fallback(RRtfallback((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRU�s	cCs|jr|jj|�S|S(N(RPR(RRtmessage((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�s	cCs|jr|jj|�S|S(N(RPR
(RRRW((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR
�s	cCs7|jr|jj|||�S|dkr/|S|SdS(Ni(RPR(RRtmsgid1tmsgid2R((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�s
	cCs7|jr|jj|||�S|dkr/|S|SdS(Ni(RPR(RRRXRYR((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�s
	cCs#|jr|jj|�St|�S(N(RPtugettexttunicode(RRRW((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRZ�s	cCsC|jr|jj|||�S|dkr5t|�St|�SdS(Ni(RPt	ungettextR[(RRRXRYR((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR\�s
	
cCs|jS(N(RL(RR((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pytinfo�scCs|jS(N(RN(RR((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pytcharset�scCs|jS(N(RO(RR((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pytoutput_charset�scCs
||_dS(N(RO(RRR^((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pytset_output_charset�scCs�ddl}|r|jp!|j|jd<t|d�r�d|kr]|jd|jd<nd|kr�|rx|jp~|j|jd<nd|kr�|j|jd<nd|kr�|j|jd<q�ndS(Ni����R<t__contains__RRR
R(	t__builtin__RZRt__dict__thasattrR\RR
R(RRR[tnamesRb((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�sN(t__name__t
__module__RMRTRQRURR
RRRZR\R]R^R_R`tFalseR(((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�s												cBsSeZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	l�*l�$<cCs�tj}t|dd�}i|_}d�|_|j�}t|�}|d|d �d}||jkr�|d|dd!�\}}	}
}d	}nL||jkr�|d
|dd!�\}}	}
}d}nt	dd|��x�t
d|	�D]�}
||||
|
d
!�\}}||}|||||d
!�\}}||}||kr�||kr�|||!}|||!}nt	dd|��|dkr�d}x|j�D]	}|j
�}|s�q�nd}}d|kr9|jdd�\}}|j
�j�}|j
�}||j|<|}n |rY|j|cd|7<n|dkr~|jd�d|_q�|dkr�|jd�}|djd�d}t|�|_q�q�Wnd|krp|jd�\}}|jd�}|jr<t||j�}g|D]}t||j�^q}nxktt|��D]}
||
|||
f<qOWn:|jr�t||j�}t||j�}n|||<|
d
7}
|d
7}q�WdS(s8Override this method to support alternative .mo formats.tnameRcSst|dk�S(Ni(tint(R((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyt<lambda>ss<Iiis<4Iis<IIs>4Is>IIsBad magic numberisFile is corruptt:is
scontent-typescharset=splural-formst;splural=tN(tstructtunpacktgetattrt_catalogR2treadR/tLE_MAGICtBE_MAGICtIOErrortxrangeRMt
splitlineststriptsplittlowerRLRNR8R[R=(RRRSRptfilenametcatalogtbuftbuflentmagictversiontmsgcountt	masteridxttransidxtiiRItmlentmofftmendttlenttoffttendtmsgttmsgtlastktitemtktvR2RXRYR((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRQst	
"	"	 
 



	
	(	

cCs}t�}|jj||�}||krG|jrC|jj|�S|S|jr`|j|j�S|jry|j|j�S|S(N(tobjectRrtgetRPRROtencodeRN(RRRWtmissingR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRZs				cCsst�}|jj||�}||krG|jrC|jj|�S|S|jr`|j|j�S|jtj��S(N(	R�RrR�RPR
ROR�Rtgetpreferredencoding(RRRWR�R�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR
hs			cCs�yV|j||j|�f}|jr8|j|j�S|jrQ|j|j�S|SWnDtk
r�|jr�|jj|||�S|dkr�|S|SnXdS(Ni(RrR2ROR�RNtKeyErrorRPR(RRRXRYRR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRss		
	cCs�yL|j||j|�f}|jr8|j|j�S|jtj��SWnDtk
r�|jr{|jj|||�S|dkr�|S|SnXdS(Ni(	RrR2ROR�RR�R�RPR(RRRXRYRR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�s	
	cCsQt�}|jj||�}||krM|jrC|jj|�St|�S|S(N(R�RrR�RPRZR[(RRRWR�R�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRZ�s		
cCs~y |j||j|�f}WnWtk
ry|jrO|jj|||�S|dkrjt|�}qzt|�}nX|S(Ni(RrR2R�RPR\R[(RRRXRYRR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR\�s 
	(RfRgRtRuRQRR
RRRZR\(((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRs	R						icCsT|dkrt}n|dkr�g}x9dD]1}tjj|�}|r.|jd�}Pq.q.Wd|kr�|jd�q�ng}xA|D]9}x0t|�D]"}||kr�|j|�q�q�Wq�W|r�g}	nd}	xl|D]d}|dkr�Pntjj	||dd|�}
tjj
|
�r�|rE|	j|
�qL|
Sq�q�W|	S(	NtLANGUAGEtLC_ALLtLC_MESSAGEStLANGRltCs%s.mo(R�sLC_ALLsLC_MESSAGESR�(RMt_default_localedirtostenvironR�RzR.RKtpathtjointexists(tdomaint	localedirt	languagestalltenvarRJtnelangstlangtnelangtresulttmofile((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�s8	

	
c	Cs|dkrt}nt|||dd�}|sU|r@t�Sttd|��nd}x�|D]�}|tjj|�f}	t	j
|	�}
|
dkr�t|d��}t	j|	||��}
WdQXnt
j
|
�}
|r�|
j|�n|dkr|
}qb|j|
�qbW|S(NR�is$No translation file found for domaintrb(RMRRRRvRR�R�tabspatht
_translationsR�topent
setdefaulttcopyR`RU(R�R�R�tclass_RVREtmofilesR�R�tkeyttRS((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�s*	
!	cCs/t||dtd|�}|j||�dS(NRVRE(RtTrueR(R�R�R[REReR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�stmessagescCs|dk	r|antS(N(RMt_current_domain(R�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR�s	cCs)|dk	r|t|<ntj|t�S(N(RMt_localedirsR�R�(R�R�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRs
cCs&|dk	r|t|<ntj|�S(N(RMt_localecodesetsR�(R�RE((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR	s
cCsPy.t|tj|d�dtj|��}Wntk
rB|SX|j|�S(NRE(RR�R�RMR�RvR(R�RWR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR
s
cCsPy.t|tj|d�dtj|��}Wntk
rB|SX|j|�S(NRE(RR�R�RMR�RvR
(R�RWR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRs
cCsiy.t|tj|d�dtj|��}Wn%tk
rU|dkrN|S|SnX|j|||�S(NREi(RR�R�RMR�RvR(R�RXRYRR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR"s
cCsiy.t|tj|d�dtj|��}Wn%tk
rU|dkrN|S|SnX|j|||�S(NREi(RR�R�RMR�RvR(R�RXRYRR�((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR-s
cCs
tt|�S(N(R
R�(RW((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR8scCs
tt|�S(N(RR�(RW((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR
;scCstt|||�S(N(RR�(RXRYR((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyR>scCstt|||�S(N(RR�(RXRYR((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyRAs(((t__doc__RR�R�R,RotsysterrnoRt__all__R�R�tprefixR�RR8RKRRRMRR�RhRRR�R�R�RRR	R
RRRRR
RRR(((s`/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/gettext.pyt<module>sB&H			7	+T�&