Ñò $œœIc@s…dZddkZyddklZWnej o dZnXyddklZWnej o dZnXei dƒZ ei dƒZ ei dƒZ hdd 6d d 6d d 6dd6dd6dd6dd6Z x1edƒD]#Ze ieeƒdefƒqãWedƒZeZd„Zd„ZepeZdefd„ƒYZeeeeeeee e!e"e#e$e%d„ Z&dS(sImplementation of JSONEncoder iÿÿÿÿN(tencode_basestring_ascii(t make_encoders[\x00-\x1f\\"\b\f\n\r\t]s([\\"]|[^\ -~])s [\x80-\xff]s\\s\s\"t"s\bss\fs s\ns s\rs s\ts i s\u%04xt1e66666cCs!d„}dti||ƒdS(s5Return a JSON representation of a Python string cSst|idƒS(Ni(t ESCAPE_DCTtgroup(tmatch((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytreplace&sR(tESCAPEtsub(tsR((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytencode_basestring"s cCs`t|tƒo)ti|ƒdj o|idƒ}nd„}dtti||ƒƒdS(sAReturn an ASCII-only JSON representation of a Python string sutf-8cSs’|idƒ}y t|SWnptj odt|ƒ}|djo d|fS|d8}d|d?d@B}d|d@B}d||fSnXdS( Niis\u%04xiØi iÿiÜs \u%04x\u%04x(RRtKeyErrortord(RR tnts1ts2((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyR1s     RN(t isinstancetstrtHAS_UTF8tsearchtNonetdecodet ESCAPE_ASCIIR (R R((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytpy_encode_basestring_ascii+s& t JSONEncoderc Bs\eZdZdZdZeeeeeddddd„ Zd„Z d„Z ed„Z RS( sZExtensible JSON 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( tskipkeyst ensure_asciitcheck_circulart allow_nant sort_keystindentRtitem_separatort key_separatortdefaulttencoding( tselfRRRRRRt separatorsR#R"((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyt__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 TypeErrortrepr(R$to((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyR"ŸscCsÆt|tƒont|tƒo;|i}|dj o!|dj o|i|ƒ}q[n|io t|ƒSt|ƒSn|i |dt ƒ}t|t t fƒ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(Rt basestringRR#RRRRR t iterencodetTruetlistttupletjoin(R$R)t _encodingtchunks((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytencode³s    c Cs |io h}nd}|io t}nt}|idjo||id„}n|ittt d„}|o`t dj 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-8cSs-t|tƒo|i|ƒ}n||ƒS(N(RRR(R)t _orig_encoderR2((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyt_encoderàscSst||jo d}n9||jo d}n"||jo d}n ||ƒS|ptdt|ƒƒ‚n|S(NtNaNtInfinitys -Infinitys2Out of range float values are not JSON compliant: (t ValueErrorR((R)Rt_reprt_inft_neginfttext((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytfloatstrås       iN(RRRRR R#Rt FLOAT_REPRtINFINITYtc_make_encoderRRR"R!R Rt_make_iterencode(R$R)R*tmarkersR6R>t _iterencode((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyR-Ís&    *N( t__name__t __module__t__doc__R R!tFalseR.RR&R"R4R-(((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyRFs 8  cs뇇‡‡‡ ‡‡‡‡ ‡ ‡‡ ‡‡‡‡‡‡‡‡‡fd†‰‡‡‡‡‡‡‡‡‡‡‡ ‡ ‡ ‡ ‡ ‡‡‡‡‡‡‡‡‡fd†‰‡‡‡‡‡ ‡‡‡‡ ‡‡ ‡‡‡‡‡‡‡‡‡fd†‰ˆS(Nc 3sV|p dVdSˆdj o7ˆ|ƒ}|ˆjoˆdƒ‚n|ˆ|asRLRMRKskey s is not a stringt}(Rtitemstsortt iteritemsR'R(( tdctRPRQRSR RURgRcRVR3RW(Rat_key_separatorRXRYRZR^RR[R\R6R,R]RCt _sort_keysR_R`t _skipkeysR.R9R0RHR/RRD(s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyR`LsŠ                            c3sœˆ|ˆƒoˆ|ƒVnz|djo dVnd|ˆ jo dVnN|ˆjo dVn8ˆ|ˆˆ fƒoˆ|ƒVnˆ|ˆƒoˆ|ƒVnôˆ|ˆˆfƒo#xÚˆ||ƒD] }|VqËWn»ˆ|ˆ ƒo#x§ˆ ||ƒD] }|VqþWnˆˆdj o7ˆ|ƒ}|ˆjoˆdƒ‚n|ˆ|              ((RCRnR6RaRZRkR]RlRmR*RHR.R9R,R_RYR[RXRR/R^RR0((R6RkRXRYRZR^RR[R\R,R]RCRlR_R`RnRmR.R9R0RaRHR/RRDs8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyRBsK5TMH('RGtretsimplejson._speedupsRtc_encode_basestring_asciit ImportErrorRRRAtcompileRRRRtrangetit setdefaulttchrRYR@R(R?R RtobjectRRHR.R9R,R_R[RXRR/R^RR0RB(((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytsT     !   Â