MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/2/cwd/proc/3/cwd/usr/lib/python2.4/encodings/punycode.pyc
mò
‚=5Dc@sßdZdkZd„Zd„Zd„Zd„Zd„ZdZd„Zd	„Z	d
„Z
d„Zd„Zd
„Z
d„Zdeifd„ƒYZdeeifd„ƒYZdeeifd„ƒYZd„ZdS(sX Codec for the Punicode encoding, as specified in RFC 3492

Written by Martin v. Löwis.
NcCs}g}h}x<|D]4}t|ƒdjo|i|ƒqd||<qW|iƒ}|iƒdi|ƒi	dƒ|fS(s 3.1 Basic code point segregationi€ittasciiN(
tbasetextendedtstrtctordtappendtkeystsorttjointencode(RRRR((t(/usr/lib/python2.4/encodings/punycode.pyt	segregates
cCs<d}x/|D]'}t|ƒ|jo|d7}q
q
W|S(s@Return the length of str, considering only characters below max.iiN(tresRRRtmax(RRRR((Rt
selective_lenscCs{t|ƒ}xh|d7}||jodSn||}||jo|d|fSq||jo|d7}qqWdS(sReturn a pair (index, pos), indicating the next occurrence of
    char in str. index is the position of the character considering
    only ordinals up to and including char, and pos is the position in
    the full string. index/pos is the starting position in the full
    string.iiÿÿÿÿN(iÿÿÿÿiÿÿÿÿ(tlenRtltposRtchartindex(RRRRRR((Rtselective_find s




cCsÄd}g}d}x«|D]£}d}}t|ƒ}t	||ƒ}
|
d||}	x]t
||||ƒ\}}|djoPn|	||7}	|i|	dƒ|}d}	qYW|}qW|S(s3.2 Insertion unsort codingi€iÿÿÿÿiiN(toldchartresulttoldindexRRRRRRRRtcurlentdeltaRR(RRRRRRRRRRR((Rtinsertion_unsort2s*


cCs@d|d|}|djodSn|djodSn|S(Ni$ii(tjtbiasR(RRR((RtTHs

t$abcdefghijklmnopqrstuvwxyz0123456789cCsŠg}d}xwt||ƒ}||jo|it|ƒ|Sn|it|||d|ƒ||d|}|d7}qWdS(s(3.3 Generalized variable-length integersiii$N(RRRRtttNRtdigits(R"RRR!R((Rtgenerate_generalized_integerPs
!cCsv|o|d}n|d}|||7}d}x&|djo|d}|d7}q6W|d||d}|S(Ni¼iiiÇi#i$i&(tfirstRtnumcharst	divisionsR(RR%R&RR'((Rtadapt]s


cCsrg}d}xVt|ƒD]H\}}t||ƒ}|i|ƒt	||dj||dƒ}qWdi|ƒS(s3.4 Bias adaptationiHiiRN(RRt	enumeratetdeltastpointsRR$tstextendR(tbaselenR
(R.R*RR,RRR+((Rtgenerate_integersls

$cCs`t|ƒ\}}|idƒ}t||ƒ}tt|ƒ|ƒ}|o|d|Sn|S(NRt-(	R
ttextRRRRR*R/R(R1R*RR((Rtpunycode_encodewsc
CsQd}d}	d}x8yt||ƒ}Wn;tj
o/|djo
t	d‚n|ddfSnX|d7}d|jo
djno|d}n\d|jo
djno|d	}n0|djot	d
||ƒ‚n|dfSt||ƒ}|||	7}||jo||fSn|	d|}	|d7}qWdS(
s(3.3 Generalized variable-length integersiitstrictsincomplete punicode stringiAiZi0i9is Invalid extended code point '%s'i$N(RtwRRRtextposRt
IndexErrorterrorstUnicodeErrortNonetdigitRRR!(
RR5RR7RR:R!RRR4((Rtdecode_generalized_number‚s4





c	Csd}d}d}d}xý|t|ƒjoét||||ƒ\}}|d
jo|Sn||d7}||t|ƒd7}|djo.|djotd|‚nt
d	ƒ}n|t|ƒd}|| t|ƒ||}t||djt|ƒƒ}|}qW|S(s3.2 Insertion unsort codingi€iÿÿÿÿiHiiiÿÿR3sInvalid character U+%xt?N(RRRR5RRR;R7tnewposRR9RR8RtunichrR((	RRR7R5R=RRRR((Rtinsertion_sort s,	


cCsr|idƒ}|djod}|}n|| }||d}t|d|ƒ}|iƒ}t|||ƒS(NR0iÿÿÿÿRiR(	R1trfindRRRtunicodeR7tupperR?(R1R7RRR((Rtpunycode_decode¹s


tCodeccBs tZdd„Zdd„ZRS(NR3cCst|ƒ}|t|ƒfS(N(R2tinputRR(tselfRER7R((RRÈscCs=|djotd|‚nt||ƒ}|t|ƒfS(NR3treplacetignoresUnsupported error handling (sstrictsreplacesignore(R7R8RCRERR(RFRER7R((RtdecodeÍs
(t__name__t
__module__RRI(((RRDÇstStreamWritercBstZRS(N(RJRK(((RRLÔstStreamReadercBstZRS(N(RJRK(((RRM×scCstƒitƒittfS(N(RDRRIRMRL(((RtgetregentryÜs(t__doc__tcodecsR
RRRRR#R$R(R/R2R;R?RCRDRLRMRN(R#RLRCRNRR2RR
RDRRPR/R$RR?RMR;R(((RR<s$