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/self/root/proc/2/root/usr/lib/python2.4/Tools/scripts/gencodec.pyo
mς
‚=5Dc@s
dZdkZdkZdkZdkZdZeidƒZee	e
d„Zd„Zd„Z
d„Zd„Zdd	„Zdd
„Zd„Zddd
„Zddd„ZedjoEdkZeeeeidƒƒqeeeeidƒƒndS(sG Unicode Mapping Parser and Codec Generator.

This script parses Unicode mapping files as available from the Unicode
site (ftp://ftp.unicode.org/Public/MAPPINGS/) and creates Python codec
modules from them. The codecs use the standard character mapping codec
to actually apply the mapping.

Synopsis: gencodec.py dir codec_prefix

All files in dir are scanned and those producing non-empty mappings
will be written to <codec_prefix><mapname>.py with <mapname> being the
first part of the map's filename ('a' in a.b.c.txt) converted to
lowercase with hyphens replaced by underscores.

The tool also writes marshalled versions of the mapping tables to the
same location (with .mapping extension).

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright Guido van Rossum, 2000.

NisL((?:0x[0-9a-fA-F]+\+?)+)\s+((?:(?:0x[0-9a-fA-Z]+|<[A-Za-z]+>)\+?)*)\s*(#.+)?cCsέ|pdSn|idƒ}||ƒdjot|ddƒSnxU|||ƒƒD]A}yt||dƒ||<WqYtj
od||<qYXqYW|d„|ƒ}||ƒdjo|dSnt
|ƒSdS(sο Converts code combinations to either a single code integer
        or a tuple of integers.

        meta-codes (in angular brackets, e.g. <LR> and <RL>) are
        ignored.

        Empty codes or illegal ones are returned as None.

    t+iiicCs
|dj	S(N(txtNone(R((t,/usr/lib/python2.4/Tools/scripts/gencodec.pyt<lambda>:sN(tcodesRtsplittltlentinttrangetit
ValueErrortfilterttuple(RRR
R
RR((Rt
parsecodes$s cCs’t|dƒ}|iƒ}|iƒh}
g}tdƒ}xtdƒD]}|||<qJWxϋ|D]σ}	|	iƒ}	|	p|	ddjoqent
i|	ƒ}|pqen|iƒ\}}}t|ƒ}t|ƒ}|p
d}n|d}|djo?|i|ƒ||jo|i|ƒqX||f|
|<qe||f|
|<qeWt|ƒt|ƒjo)x|D]}d|
|<q|Wd|
d<n|
S(	Ntriit#titIDENTITY(NR(topentfilenametft	readlinestlinestclosetenc2unitidentityR
tunmappedRtlinetstriptmapREtmatchtmtgroupstenctunitcommentRtremovetappendRR(RR%R#RRR!RRR$RRR((Rtreadmap@sF






cCsV|djodSnyt|ƒWnd|SnXdditd„|ƒƒdS(NRs0x%04xt(s, cCsd|S(Ns0x%04x(tt(R*((RRsst)(R*RRtjointmap(R*((Rthexreprks
cCsr|djodSntot|ƒSnEyt|ƒWntt|ƒƒSnXtditt|ƒƒƒSdS(NRR(	R*RtnumericR.RtreprtunichrR,R-(R*((Rtunicodereprus
cCs“|djodSntot|ƒSnfyt|ƒWn8|djott|ƒƒSqstt|ƒƒSnXtdit	t|ƒƒƒSdS(NRiR(
R*RR/R.RR0tchrR1R,R-(R*((Rtkeyrepr‚s

c
CsΌd|g}|idƒo3|id|dƒ|idƒd}|d=n|idƒd}|iƒ}|iƒ|i}d}xυ|D]ν\}}	y|	\}}Wntj
o|	}d}nXt|ƒ}
|o(|o!|d	|
t|ƒ|fƒn|d
|
t|ƒfƒ|d7}|djoC|djo|dƒn|d
ƒ|dƒd}|d}qqW|djo|dƒn|d
ƒ|dƒdi|ƒS(s| Returns Python source for the given map.

        Comments are included in the source, if comments is true (default).

    s_""" Python Character Mapping Codec generated from '%s' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):

        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):

        return codecs.charmap_decode(input,errors,decoding_map)

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():

    return (Codec().encode,Codec().decode,StreamReader,StreamWriter)

### Decoding Map
Rs3decoding_map = codecs.make_identity_dict(range(%d))sdecoding_map.update({isdecoding_map = {iRs
	%s: %s,	# %ss	%s: %s,it}s})sI
### Encoding Map

encoding_map = codecs.make_encoding_map(decoding_map)
s
N(tnameRR-thas_keyR'tsplitstitemstmappingstsortRtetvaluetutct	TypeErrorR4tkeytcommentsR2R,(
R6R-RBR?R<R8RRR>R=RAR'R:((Rtcodegen’sJ
$


	!







cCs<t|||ƒ}t|dƒ}|i|ƒ|i	ƒdS(Ntw(
RCR6R-RBtcodeRtpyfileRtwriteR(R6R-RFRBRER((Rtpymapμs
cCsfh}x0|iƒD]"\}\}}||f||<qWt|dƒ}t	i
||ƒ|iƒdS(Ntwb(tdR-R9R<R>R?RtmarshalfileRtmarshaltdumpR(R6R-RKR?R<RR>RJ((Rt
marshalmapσs
Rc	Csti|ƒ}xψ|D]π}tii|ƒd}|iddƒ}|idƒd}|i	ƒ}|d}|d}d|||||fGHyZt
tii||ƒƒ}|p	d	GHn,t|||||ƒt||||ƒWqtj
od
GHqXqWdS(Nit-t_t.is.pys.mappingsconverting %s to %s and %ss* map is empty; skippings* conversion failed(tostlistdirtdirtmapnamestmapnametpathRR6treplacetlowertcodefileRKtprefixR(R,R-RHRBRNR(	RTR[RBR-R6RVRKRZRU((Rt
convertdirόs$

	cCsΦti|ƒ}xΐ|D]Έ}|idƒpqn|tdƒ d}d|||fGHyRt	i
ttii
||ƒdƒƒ}|p	dGHnt|||||ƒWqtj
o}d|GHqXqWdS(Ns.mappings.pysconverting %s to %strbs* map is empty; skippings* conversion failed: %s(RRRSRTRURVtendswithRRZR[RLtloadRRWR,R-RHRBRtwhy(RTR[RBR-R`RVRZRU((Rtrewritepythondirs	t__main__(t__doc__treRRttimeRLR/tcompileRRR
R
RR(R.R2R4RCRHRNR\Rat__name__tsystapplyRtargv(RNR/R(RHRdRRhR4R.R\RRaRCReRRRLR2((Rt?s$$	+	
	
	Z