/usr/lib64/python2.6/site-packages/simplejson
NameSizeModeActions
tests/-0755rm
compat.py10360644editdlrm
compat.pyc20400644editdlrm
decoder.py147210644editdlrm
decoder.pyc126500644editdlrm
decoder.pyo126500644editdlrm
encoder.py266290644editdlrm
encoder.pyc210780644editdlrm
encoder.pyo210780644editdlrm
ordered_dict.py33700644editdlrm
ordered_dict.pyc51900644editdlrm
ordered_dict.pyo51900644editdlrm
scanner.py46530644editdlrm
scanner.pyc51400644editdlrm
scanner.pyo51400644editdlrm
tool.py11360644editdlrm
tool.pyc14990644editdlrm
tool.pyo14990644editdlrm
_speedups.so1439930644editdlrm
__init__.py236880644editdlrm
__init__.pyc219670644editdlrm
__init__.pyo219670644editdlrm
Edit: /usr/lib64/python2.6/site-packages/simplejson/encoder.pyc (21078B)
Ñò }DVc@@sôdZddklZddkZddklZddkZddklZl Z l Z l Z l Z l Z d„Zeƒ\ZZddklZeid ƒZeid ƒZeid ƒZhd d 6dd6dd6dd6dd6dd6dd6Zx1edƒD]#ZeieeƒdefƒqWx1ddgD]#Zeie eƒdefƒq9WeZe edƒd„Ze d„ZepeZ d e!fd!„ƒYZ"d"e"fd#„ƒYZ#e e$e e%e&e'e(e e)e*e+e,e-d$„ Z.dS(%sImplementation of JSONEncoder i(tabsolute_importN(t itemgetteri(tutunichrt binary_typet string_typest integer_typestPY3cC@s?y$ddkl}|i|ifSWntj odSXdS(Ni(t _speedups(NN(tRtencode_basestring_asciit make_encodert ImportErrortNone(R((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyt_import_speedups s (tPosInfu[\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%04xi( i) cC@sˆ|o't|tƒo|idƒ}qgn:t|tƒo)ti|ƒdj o|idƒ}nd„}|ti||ƒ|S(s5Return a JSON representation of a Python string sutf-8cS@st|idƒS(Ni(t ESCAPE_DCTtgroup(tmatch((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytreplace4sN( t isinstanceRtdecodetstrtHAS_UTF8tsearchR tESCAPEtsub(tst_PY3t_qR((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytencode_basestring*s& cC@sŽ|o't|tƒo|idƒ}qgn:t|tƒo)ti|ƒdj o|idƒ}nd„}dtti||ƒƒdS(sAReturn an ASCII-only JSON representation of a Python string sutf-8cS@s’|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(RRtnts1ts2((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyRCs     RN( RRRRRRR t ESCAPE_ASCIIR(RRR((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytpy_encode_basestring_ascii9s& t JSONEncodercB@sweZdZdZdZeeeeeddddeeeedeeded„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, namedtuple | 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-8cC@s||_||_||_||_||_| |_| |_| |_||_| |_ ||_ ||_ ||_ ||_ |dj ot|tƒ o|d}n||_|dj o|\|_|_n|dj o d|_n| dj o | |_n||_dS(s²Constructor 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 string, then JSON array elements and object members will be pretty-printed with a newline followed by that string repeated for each level of nesting. ``None`` (the default) selects the most compact representation without any newlines. For backwards compatibility with versions of simplejson earlier than 2.1.0, an integer is also accepted and is converted to a string with that many spaces. If specified, separators should be an (item_separator, key_separator) tuple. The default is (', ', ': ') if *indent* is ``None`` and (',', ': ') otherwise. 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. If use_decimal is true (not the default), ``decimal.Decimal`` will be supported directly by the encoder. For the inverse, decode JSON with ``parse_float=decimal.Decimal``. If namedtuple_as_object is true (the default), objects with ``_asdict()`` methods will be encoded as JSON objects. If tuple_as_array is true (the default), tuple (and subclasses) will be encoded as JSON arrays. If *iterable_as_array* is true (default: ``False``), any object not in the above table that implements ``__iter__()`` will be encoded as a JSON array. If bigint_as_string is true (not the default), ints 2**53 and higher or lower than -2**53 will be encoded as strings. This is to avoid the rounding that happens in Javascript otherwise. If int_as_string_bitcount is a positive number (n), then int of size greater than or equal to 2**n or lower than or equal to -2**n will be encoded as strings. If specified, item_sort_key is a callable used to sort the items in each dictionary. This is useful if you want to sort items other than in alphabetical order by key. If for_json is true (not the default), objects with a ``for_json()`` method will use the return value of that method for encoding as JSON instead of the object. If *ignore_nan* is true (default: ``False``), then out of range :class:`float` values (``nan``, ``inf``, ``-inf``) will be serialized as ``null`` in compliance with the ECMA-262 specification. If true, this will override *allow_nan*. t t,N(tskipkeyst ensure_asciitcheck_circulart allow_nant sort_keyst use_decimaltnamedtuple_as_objectttuple_as_arraytiterable_as_arraytbigint_as_stringt item_sort_keytfor_jsont ignore_nantint_as_string_bitcountR RRtindenttitem_separatort key_separatortdefaulttencoding(tselfR*R+R,R-R.R8t separatorsR<R;R/R0R1R3R4R5R6R7R2((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyt__init__ys0X                    cC@stt|ƒ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;êscC@sât|tƒo;|i}|dj o!|dj o|i|ƒ}qKnt|tƒo#|io t|ƒSt|ƒSn|i |dt ƒ}t|t t fƒpt |ƒ}n|iodi |ƒSdi |ƒSdS(sÕReturn a JSON string representation of a Python data structure. >>> from simplejson import JSONEncoder >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' sutf-8t _one_shotR uN(RRR<R RRR+R Rt iterencodetTruetlistttupletjoin(R=RBt _encodingtchunks((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytencodeþs     c C@sÈ|io h}nd}|io t}nt}|idjo||id„}n|i|itt t d„}h}|i odn|i }|o–t dj o‰|i djoyt ||i||i |i|i|i|i|i||i|i|i||i|i|i|iti|iƒ}npt||i||i ||i|i|i|i||i|i|i||i|i|i|idtiƒ}z||dƒSWd|iƒXdS(sØEncode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) sutf-8cS@s-t|tƒo|i|ƒ}n||ƒS(N(RRR(RBt _orig_encoderRI((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyt_encoder.scS@s¨||jo d}n\||jo d}nE||jo d}n.t|ƒtjot|ƒ}n||ƒS|o d}n"|ptdt|ƒƒ‚n|S(NtNaNtInfinitys -Infinitytnulls2Out of range float values are not JSON compliant: (ttypetfloatt ValueErrorRA(RBR-R6t_reprt_inft_neginfttext((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pytfloatstr3s         i5tDecimaliN(R,R R+R RR<R-R6t FLOAT_REPRRR3R7tc_make_encoderR8R;R:R9R.R*R/R0R1R4R5tdecimalRYR2t_make_iterencodetclear( R=RBRCtmarkersRMRXtkey_memoR7t _iterencode((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyRDsB       N( t__name__t __module__t__doc__R9R:tFalseRER R?R;RKRD(((s8/usr/lib64/python2.6/site-packages/simplejson/encoder.pyR'Ys   k  tJSONEncoderForHTMLcB@s#eZdZd„Zed„ZRS(s"An encoder that produces JSON safe to embed in HTML. To embed JSON content in, say, a script tag on a web page, the characters &, < and > should be escaped. They cannot be escaped with the usual entities (e.g. &) because they are not expanded within