%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/gettext.pyc


Mac@sIdZddlZddlZddlZddlZddlZddlZddlmZdddddd	d
ddd
dddddddgZ	ej
jejddZ
ejdejejBZdZdZdBdCdDdEdFdGfZd'eed(DZid)d6d*d6d+d%6Zdd,Zd-Zd.Zd/ZddHd0YZdefd1YZddd2d3ZiZddde dd4Z!de ddd5Z"ia#ia$d6a%dd7Z&dd8Z'dd9Z(d:Z)d;Z*d<Z+d=Z,d>Z-d?Z.d@Z/dAZ0e!Z1dS(IsInternationalization 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.

iN(tENOENTtNullTranslationstGNUTranslationstCatalogtfindttranslationtinstallt
textdomaintbindtextdomaintbind_textdomain_codesettdgettextt	dngettexttgettexttlgettextt	ldgettextt
ldngettextt	lngettexttngettexttsharetlocales
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    ccstxhtjt|D]T}|j}|dkr4qn|j|}|dkrbtd|n|VqWdVdS(NtWHITESPACEStINVALIDs invalid token in plural form: %st(tretfinditert_token_patternt	lastgrouptgroupt
ValueError(tpluraltmotkindtvalue((s#/usr/local/lib/python2.7/gettext.pyt	_tokenizeTs		cCs"|rtd|StdSdS(Ns#unexpected token in plural form: %ssunexpected end of plural form(R(R ((s#/usr/local/lib/python2.7/gettext.pyt_error_ss||s&&s==s!=t<t>s<=s>=t+t-t*t/t%cCs,i|]"\}}|D]}||qqS(((t.0titopstop((s#/usr/local/lib/python2.7/gettext.pys
<dictcomp>ms	itortands//cCsMd}t|}x&|dkr:|d7}t|}qW|dkrt|\}}d||f}|dkrtdqnb|dkrd	||f}nCyt|d
}Wntk
rt|nXd||f}t|}d}x|tkrt|}||kr$Pn|dkrI|dkrId|}ntj||}t||d\}	}d|||	f}|}qW||kodknrd|}n|dkrC|dkrCt|d\}
}|dkrt|nt|\}}d|
||f}|dkrCd|}qCn||fS(NRt!snot t(s%s(%s)t)s%unbalanced parenthesis in plural formtns%s%si
s%s%didiis(%s)is%s %s %st?it:s%s if %s else %s(ii(ii(tnextt_parseRtintR"t_binary_opst	_c2py_opstget(ttokenstprioritytresulttnexttoktsubR tjR+R-trighttif_truetif_false((s#/usr/local/lib/python2.7/gettext.pyR7psP





cCsAyt|}Wn*tk
r<td|jjfnX|S(Ns'Plural value must be an integer, got %s(troundt	TypeErrort	__class__t__name__(R3R+((s#/usr/local/lib/python2.7/gettext.pyt_as_ints
cBse|dkr!ednyee|\}}|rQe|nd}x[|D]S}|dkr|d7}|dkredqq^|dkr^|d8}q^q^Wied	6}d
||U|dSWnek
rednXdS(
sGets a C expression as used in PO files for plural forms and returns a
    Python function that implements an equivalent expression.
    is"plural form expression is too longiR1iis%plural form expression is too complexR2RIsif 1:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            tfuncN(tlenRR7R!R"RItRuntimeError(RR>R?tdepthtctns((s#/usr/local/lib/python2.7/gettext.pytc2pys&



cCsddlm}||}d
}d}d}d}|jd}|dkrp||}|| }||O}nd}|jd}|dkr||}|| }||O}nd}|jd	}|dkr||}	|| }||O}nd}	|}
g}x~t|dD]l}||@s|
}
||@rE|
|	7}
n||@r\|
|7}
n||@rs|
|7}
n|j|
qqW|j|S(
Ni(t	normalizeiiit@Rt.t_iii(RRQRtrangetappendtreverse(RRQtCOMPONENT_CODESETtCOMPONENT_TERRITORYtCOMPONENT_MODIFIERtmasktpostmodifiertcodesett	territorytlanguagetretR+tval((s#/usr/local/lib/python2.7/gettext.pyt_expand_langsL















cBseZddZdZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZedd
ZRS(cCsDi|_d|_d|_d|_|dk	r@|j|ndS(N(t_infotNonet_charsett_output_charsett	_fallbackR7(tselftfp((s#/usr/local/lib/python2.7/gettext.pyt__init__s				cCsdS(N((RiRj((s#/usr/local/lib/python2.7/gettext.pyR7scCs)|jr|jj|n	||_dS(N(Rhtadd_fallback(Ritfallback((s#/usr/local/lib/python2.7/gettext.pyRls	cCs|jr|jj|S|S(N(RhR(Ritmessage((s#/usr/local/lib/python2.7/gettext.pyR
s	cCs|jr|jj|S|S(N(RhR
(RiRn((s#/usr/local/lib/python2.7/gettext.pyR
s	cCs7|jr|jj|||S|dkr/|S|SdS(Ni(RhR(Ritmsgid1tmsgid2R3((s#/usr/local/lib/python2.7/gettext.pyRs
	cCs7|jr|jj|||S|dkr/|S|SdS(Ni(RhR(RiRoRpR3((s#/usr/local/lib/python2.7/gettext.pyRs
	cCs#|jr|jj|St|S(N(Rhtugettexttunicode(RiRn((s#/usr/local/lib/python2.7/gettext.pyRq$s	cCsC|jr|jj|||S|dkr5t|St|SdS(Ni(Rht	ungettextRr(RiRoRpR3((s#/usr/local/lib/python2.7/gettext.pyRs)s
	
cCs|jS(N(Rd(Ri((s#/usr/local/lib/python2.7/gettext.pytinfo1scCs|jS(N(Rf(Ri((s#/usr/local/lib/python2.7/gettext.pytcharset4scCs|jS(N(Rg(Ri((s#/usr/local/lib/python2.7/gettext.pytoutput_charset7scCs
||_dS(N(Rg(RiRu((s#/usr/local/lib/python2.7/gettext.pytset_output_charset:scCsddl}|r|jp!|j|jd<t|drd|kr]|jd|jd<nd|kr|rx|jp~|j|jd<nd|kr|j|jd<nd|kr|j|jd<qndS(NiRTt__contains__RRR
R(	t__builtin__RqRt__dict__thasattrRsRR
R(RiRrtnamesRy((s#/usr/local/lib/python2.7/gettext.pyR=sN(RHt
__module__ReRkR7RlRR
RRRqRsRtRuRvRwtFalseR(((s#/usr/local/lib/python2.7/gettext.pyRs												cBsSeZdZdZdZdZdZdZdZdZ	dZ
RS(	l*l$<cCstj}t|dd}i|_}d|_|j}t|}|d|d d}||jkr|d|dd!\}}	}
}d	}nL||jkr|d
|dd!\}}	}
}d}nt	dd|xt
d|	D]}
||||
|
d
!\}}||}|||||d
!\}}||}||kr||kr|||!}|||!}nt	dd||dkrd}x|jD]	}|j
}|sqnd}}d|kr9|jdd\}}|j
j}|j
}||j|<|}n |rY|j|cd|7<n|dkr~|jdd|_q|dkr|jd}|djdd}t||_qqWnd|krp|jd\}}|jd}|jr<t||j}g|D]}t||j^q}nxktt|D]}
||
|||
f<qOWn:|jrt||j}t||j}n|||<|
d
7}
|d
7}qWdS(s8Override this method to support alternative .mo formats.tnameRcSst|dkS(Ni(R8(R3((s#/usr/local/lib/python2.7/gettext.pyt<lambda>XRs<Iiis<4Iis<IIs>4Is>IIsBad magic numberisFile is corruptR5is
scontent-typescharset=splural-formst;splural=sN(tstructtunpacktgetattrt_catalogRtreadRKtLE_MAGICtBE_MAGICtIOErrortxrangeRet
splitlineststriptsplittlowerRdRfRPRrRU(RiRjRtfilenametcatalogtbuftbuflentmagictversiontmsgcountt	masteridxttransidxtiiR+tmlentmofftmendttlenttoffttendtmsgttmsgtlastktitemtktvRRoRptx((s#/usr/local/lib/python2.7/gettext.pyR7Qst	
"	"	 
 



	
	(	

cCs}t}|jj||}||krG|jrC|jj|S|S|jr`|j|jS|jry|j|jS|S(N(tobjectRR;RhRRgtencodeRf(RiRntmissingR((s#/usr/local/lib/python2.7/gettext.pyRs				cCsst}|jj||}||krG|jrC|jj|S|S|jr`|j|jS|jtjS(N(	RRR;RhR
RgRRtgetpreferredencoding(RiRnRR((s#/usr/local/lib/python2.7/gettext.pyR
s			cCsyV|j||j|f}|jr8|j|jS|jrQ|j|jS|SWnDtk
r|jr|jj|||S|dkr|S|SnXdS(Ni(RRRgRRftKeyErrorRhR(RiRoRpR3R((s#/usr/local/lib/python2.7/gettext.pyRs		
	cCsyL|j||j|f}|jr8|j|jS|jtjSWnDtk
r|jr{|jj|||S|dkr|S|SnXdS(Ni(	RRRgRRRRRhR(RiRoRpR3R((s#/usr/local/lib/python2.7/gettext.pyRs	
	cCsQt}|jj||}||krM|jrC|jj|St|S|S(N(RRR;RhRqRr(RiRnRR((s#/usr/local/lib/python2.7/gettext.pyRqs		
cCs~y |j||j|f}WnWtk
ry|jrO|jj|||S|dkrjt|}qzt|}nX|S(Ni(RRRRhRsRr(RiRoRpR3R((s#/usr/local/lib/python2.7/gettext.pyRss 
	(RHR}RRR7RR
RRRqRs(((s#/usr/local/lib/python2.7/gettext.pyRLs	R						icCsT|dkrt}n|dkrg}x9dD]1}tjj|}|r.|jd}Pq.q.Wd|kr|jdqng}xA|D]9}x0t|D]"}||kr|j|qqWqW|rg}	nd}	xl|D]d}|dkrPntjj	||dd|}
tjj
|
r|rE|	j|
qL|
SqqW|	S(	NtLANGUAGEtLC_ALLtLC_MESSAGEStLANGR5tCs%s.mo(RRRR(Ret_default_localedirtostenvironR;RRVRctpathtjointexists(tdomaint	localedirt	languagestalltenvarRbtnelangstlangtnelangR>tmofile((s#/usr/local/lib/python2.7/gettext.pyRs8	

	
c	Cs|dkrt}nt|||dd}|sU|r@tSttd|nd}x|D]}|tjj|f}	t	j
|	}
|
dkrt|d}t	j|	||}
WdQXnt
j
|
}
|r|
j|n|dkr|
}qb|j|
qbW|S(NRis$No translation file found for domaintrb(ReRRRRRRRtabspatht
_translationsR;topent
setdefaulttcopyRwRl(RRRtclass_RmR^tmofilesR>RtkeyttRj((s#/usr/local/lib/python2.7/gettext.pyRs*	
!	cCs/t||dtd|}|j||dS(NRmR^(RtTrueR(RRRrR^R|R((s#/usr/local/lib/python2.7/gettext.pyR8stmessagescCs|dk	r|antS(N(Ret_current_domain(R((s#/usr/local/lib/python2.7/gettext.pyRFs	cCs)|dk	r|t|<ntj|tS(N(Ret_localedirsR;R(RR((s#/usr/local/lib/python2.7/gettext.pyRMs
cCs&|dk	r|t|<ntj|S(N(Ret_localecodesetsR;(RR^((s#/usr/local/lib/python2.7/gettext.pyR	Ts
cCsPy.t|tj|ddtj|}Wntk
rB|SX|j|S(NR^(RRR;ReRRR(RRnR((s#/usr/local/lib/python2.7/gettext.pyR
[s
cCsPy.t|tj|ddtj|}Wntk
rB|SX|j|S(NR^(RRR;ReRRR
(RRnR((s#/usr/local/lib/python2.7/gettext.pyRcs
cCsiy.t|tj|ddtj|}Wn%tk
rU|dkrN|S|SnX|j|||S(NR^i(RRR;ReRRR(RRoRpR3R((s#/usr/local/lib/python2.7/gettext.pyRks
cCsiy.t|tj|ddtj|}Wn%tk
rU|dkrN|S|SnX|j|||S(NR^i(RRR;ReRRR(RRoRpR3R((s#/usr/local/lib/python2.7/gettext.pyRvs
cCs
tt|S(N(R
R(Rn((s#/usr/local/lib/python2.7/gettext.pyRscCs
tt|S(N(RR(Rn((s#/usr/local/lib/python2.7/gettext.pyR
scCstt|||S(N(RR(RoRpR3((s#/usr/local/lib/python2.7/gettext.pyRscCstt|||S(N(RR(RoRpR3((s#/usr/local/lib/python2.7/gettext.pyRs(s||(s&&(s==s!=(R#R$s<=s>=(R%R&(R'R(R)((2t__doc__RRRRRtsysterrnoRt__all__RRtprefixRtcompiletVERBOSEtDOTALLRR!R"R9t	enumerateR:R7RIRPRcRRReRRR~RRRRRRRR	R
RRRRR
RRR(((s#/usr/local/lib/python2.7/gettext.pyt<module>s\&H				1		$	+T&								

Zerion Mini Shell 1.0