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: //usr/lib/python2.4/site-packages/simplejson/encoder.pyc
mò
$œœIc@sŠdZdkZydklZWnej
o
dZnXydklZWnej
o
dZnXei	dƒZ
ei	dƒZei	dƒZhdd<d	d
<dd<d
d<dd<dd<dd<Z
x1edƒD]#Ze
ieeƒdefƒqèWedƒZeZd„Zd„ZepeZdefd„ƒYZeeeeeeee e!e"e#e$e%d„
Z&dS(sImplementation of JSONEncoder
N(sencode_basestring_ascii(smake_encoders[\x00-\x1f\\"\b\f\n\r\t]s([\\"]|[^\ -~])s[\x80-\xff]s\s\\t"s\"ss\bss\fs
s\ns
s\rs	s\ti s\u%04xt1e66666cCs!d„}dti||ƒdS(s5Return a JSON representation of a Python string

    cCst|idƒS(Ni(t
ESCAPE_DCTtmatchtgroup(R((t6/usr/lib/python2.4/site-packages/simplejson/encoder.pytreplace&sRN(RtESCAPEtsubts(R	R((Rtencode_basestring"s	cCs`t|tƒo)ti|ƒdj	o|idƒ}nd„}dtti	||ƒƒdS(sAReturn an ASCII-only JSON representation of a Python string

    sutf-8cCs•|idƒ}yt|SWnstj
ogt|ƒ}|djod|fSq‘|d8}d|d?d@B}d|d@B}d||fSnXdS(	Niis\u%04xiØi
iÿiÜs\u%04x\u%04x(	RRR	RtKeyErrortordtnts1ts2(RRRR
R	((RR1s

RN(
t
isinstanceR	tstrtHAS_UTF8tsearchtNonetdecodeRtESCAPE_ASCIIR(R	R((Rtpy_encode_basestring_ascii+s
&	tJSONEncoderc
Bs\tZdZdZdZeeeeeeeded„	Zd„Z	d„Z
ed„ZRS(sZExtensible JSON <http://json.org> encoder for Python data structures.

    Supports the following objects and types by default:

    +-------------------+---------------+
    | Python            | JSON          |
    +===================+===============+
    | dict              | object        |
    +-------------------+---------------+
    | list, tuple       | array         |
    +-------------------+---------------+
    | str, unicode      | string        |
    +-------------------+---------------+
    | int, long, float  | number        |
    +-------------------+---------------+
    | True              | true          |
    +-------------------+---------------+
    | False             | false         |
    +-------------------+---------------+
    | None              | null          |
    +-------------------+---------------+

    To extend this to recognize other objects, subclass and implement a
    ``.default()`` method with another method that returns a serializable
    object for ``o`` if possible, otherwise it should call the superclass
    implementation (to raise ``TypeError``).

    s, s: sutf-8c

Cs€||_||_||_||_||_||_|dj	o|\|_	|_
n|	dj	o
|	|_n||_dS(s0Constructor for JSONEncoder, with sensible defaults.

        If skipkeys is false, then it is a TypeError to attempt
        encoding of keys that are not str, int, long, float or None.  If
        skipkeys is True, such items are simply skipped.

        If ensure_ascii is true, the output is guaranteed to be str
        objects with all incoming unicode characters escaped.  If
        ensure_ascii is false, the output will be unicode object.

        If check_circular is true, then lists, dicts, and custom encoded
        objects will be checked for circular references during encoding to
        prevent an infinite recursion (which would cause an OverflowError).
        Otherwise, no such check takes place.

        If allow_nan is true, then NaN, Infinity, and -Infinity will be
        encoded as such.  This behavior is not JSON specification compliant,
        but is consistent with most JavaScript based encoders and decoders.
        Otherwise, it will be a ValueError to encode such floats.

        If sort_keys is true, then the output of dictionaries will be
        sorted by key; this is useful for regression tests to ensure
        that JSON serializations can be compared on a day-to-day basis.

        If indent is a non-negative integer, then JSON array
        elements and object members will be pretty-printed with that
        indent level.  An indent level of 0 will only insert newlines.
        None is the most compact representation.

        If specified, separators should be a (item_separator, key_separator)
        tuple.  The default is (', ', ': ').  To get the most compact JSON
        representation you should specify (',', ':') to eliminate whitespace.

        If specified, default is a function that gets called for objects
        that can't otherwise be serialized.  It should return a JSON encodable
        version of the object or raise a ``TypeError``.

        If encoding is not None, then all input strings will be
        transformed into unicode using that encoding prior to JSON-encoding.
        The default is UTF-8.

        N(
tskipkeystselftensure_asciitcheck_circulart	allow_nant	sort_keystindentt
separatorsRtitem_separatort
key_separatortdefaulttencoding(
RRRRRRRR R$R#((Rt__init__es,						


cCstt|ƒdƒ‚dS(s$Implement this method in a subclass such that it returns
        a serializable object for ``o``, or calls the base implementation
        (to raise a ``TypeError``).

        For example, to support arbitrary iterators, you could
        implement default like this::

            def default(self, o):
                try:
                    iterable = iter(o)
                except TypeError:
                    pass
                else:
                    return list(iterable)
                return JSONEncoder.default(self, o)

        s is not JSON serializableN(t	TypeErrortreprto(RR(((RR#ŸscCsÉt|tƒoqt|tƒo;|i}|dj	o!|djo|i|ƒ}q[n|i	ot
|ƒSqt|ƒSn|i|dt
ƒ}t|ttfƒpt|ƒ}ndi|ƒS(s¦Return a JSON string representation of a Python data structure.

        >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
        '{"foo": ["bar", "baz"]}'

        sutf-8t	_one_shottN(RR(t
basestringRRR$t	_encodingRRRtencode_basestring_asciiR
t
iterencodetTruetchunkstlistttupletjoin(RR(R,R0((Rtencode³s	
cCs |io
h}nd}|io
t}nt}|idjo||id„}n|i	t
ttd„}|o`tdj	oS|ioH|io=t||i||i|i|i|i|i|i	ƒ	}n:t||i||i||i|i|i|i|ƒ
}||dƒS(sØEncode the given object and yield each string
        representation as available.

        For example::

            for chunk in JSONEncoder().iterencode(bigobject):
                mysocket.write(chunk)

        sutf-8cCs-t|tƒo|i|ƒ}n||ƒS(N(RR(RRR,t
_orig_encoder(R(R5R,((Rt_encoderàscCst||jo
d}n9||jo
d}n"||jo
d}n||ƒS|ptdt|ƒƒ‚n|S(NtNaNtInfinitys	-Infinitys2Out of range float values are not JSON compliant: (R(ttextt_inft_neginft_reprRt
ValueErrorR'(R(RR<R:R;R9((Rtfloatstrås






iN(RRtmarkersRRR-R6R
R$Rt
FLOAT_REPRtINFINITYR>R)tc_make_encoderRRR#R"R!Rt_iterencodet_make_iterencodeR((RR(R)R6R>R?RC((RR.Ís$	



*(t__name__t
__module__t__doc__R!R"tFalseR/RR%R#R4R.(((RRFs$:		cBs⇇‡‡‡‡‡‡‡‡‡‡
‡‡
‡‡‡‡	‡‡‡d†‰‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡
‡‡‡
‡‡‡	‡‡‡d†‰‡‡‡‡‡‡‡‡‡‡‡
‡‡‡
‡‡‡	‡‡‡d†‰ˆS(Nc
#sN|pdVdSnˆdj	o7ˆ|ƒ}|ˆjoˆdƒ‚n|ˆ|<nd}ˆdj	o4|d7}ddˆ|}ˆ	|}||7}n
d}ˆ	}ˆ
}	xP|D]H}|	o
ˆ}	n|}ˆ|ˆƒo|ˆ|ƒVq·|djo|dVq·|ˆ
jo|dVq·|ˆjo|d	Vq·ˆ|ˆˆ
fƒo|ˆ|ƒVq·ˆ|ˆƒo|ˆ|ƒVq·|Vˆ|ˆˆfƒoˆ||ƒ}n3ˆ|ˆƒoˆ||ƒ}nˆ||ƒ}x|D]
}|VqñWq·W|dj	o|d8}ddˆ|Vnd
Vˆdj	oˆ|=ndS(Ns[]sCircular reference detectedt[is
t tnullttruetfalset]( tlstR?RtidtmarkeridR=tbuft_indentt_current_indent_leveltnewline_indentt_item_separatort	separatorR/tfirsttvalueRHRR+R6tinttlongRtfloatt	_floatstrR1R2t_iterencode_listR0tdictt_iterencode_dictRCtchunk(
RORTRaR0RURQRRRYRWRX(R6RZR\R]R?RRPR^R+RVR[R_R`R/R=R2RSRHR1RRC(RR^sb











c#s9|pdVdSnˆdj	o7ˆ|ƒ}|ˆjoˆdƒ‚n|ˆ|<ndVˆdj	o.|d7}ddˆ|}ˆ|}|Vn
d}ˆ}ˆ}
ˆ
o#|iƒ}|idd„ƒn
|iƒ}x
|D]\}}	ˆ|ˆ
ƒon´ˆ|ˆƒoˆ|ƒ}n”|ˆjo
d	}n}|ˆjo
d
}nf|djo
d}nOˆ|ˆˆfƒoˆ|ƒ}n)ˆoqåntdt|ƒd
ƒ‚|
o
ˆ}
n|Vˆ	|ƒVˆVˆ|	ˆ
ƒoˆ	|	ƒVqå|	djodVqå|	ˆjod	Vqå|	ˆjod
Vqåˆ|	ˆˆfƒoˆ|	ƒVqåˆ|	ˆƒoˆ|	ƒVqåˆ|	ˆˆfƒoˆ|	|ƒ}n3ˆ|	ˆƒoˆ|	|ƒ}nˆ|	|ƒ}x|D]
}|VqÜWqåW|dj	o|d8}ddˆ|VndVˆdj	oˆ|=ndS(Ns{}sCircular reference detectedt{is
RJtkeycCs|dS(Ni(tkv(Rd((Rt<lambda>asRLRMRKskey s is not a stringt}((tdctR?RRPRQR=RSRTRURVR!R/RXt
_sort_keystitemstsortt	iteritemsRcRYRR+R\R]RHRZR[Rt	_skipkeysR&R'R6t_key_separatorR1R2R^R0R_R`RCRa(RgRTRaR0RUR!RQRcRiRYRX(RSRmRZR\R]R[RRPR^R6R+RVR?RhR_R`RlR/R=R2RHR1RRC(RR`LsŠ


















c#s“ˆ|ˆƒoˆ|ƒVnr|djodVn]|ˆ
jodVnH|ˆjodVn3ˆ|ˆˆ	fƒoˆ|ƒVnˆ|ˆƒoˆ|ƒVnñˆ|ˆˆfƒo"x׈||ƒD]
}|VqÅWn¹ˆ|ˆ
ƒo"x¥ˆ||ƒD]
}|Vq÷Wn‡ˆdj	o7ˆ|ƒ}|ˆjoˆdƒ‚n|ˆ|<nˆ|ƒ}xˆ||ƒD]
}|VqiWˆdj	oˆ|=ndS(NRKRLRMsCircular reference detected(RR(R+R6RR/RHRZR[RR\R]R1R2R^RTRaR_R`R?RPRQR=t_defaultRC(R(RTRaRQ(R6RZR\R]R?RRPR^R+R[R_R`RnR/R=R2RHR1RRC(RRC™s>





(R^R`RC(R?RnR6RSR]RmRVRhRlR)RHR/R=R+R_R\RPRZRR1R[RR2R^R`RC((R?RnR6RSR]RmRVRhRlRHR/R=R+R_R\RPRZRR1R[RR2R^R`RCRRDsH5QME('RGtretsimplejson._speedupsR-tc_encode_basestring_asciitImportErrorRtmake_encoderRBtcompileRRRRtrangetit
setdefaulttchrR\RAR'R@R
RtobjectRRHR/R=R+R_RPRZRR1R[RR2RD(RDRRRRqRoRARBR-RRR@RRvR
((Rt?s.	E	
!			
À