403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/simplejson/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/simplejson/encoder.pyc
ó
³üNc@swdZddlZddlmZd„Zeƒ\ZZddlmZej	dƒZ
ej	dƒZej	dƒZi	d	d
6dd6d
d6dd6dd6dd6dd6dd6dd6Z
x1edƒD]#Ze
jeeƒdefƒqÉWeZd„Zd„ZepeZdefd „ƒYZd!efd"„ƒYZeeeeeeee e!e"e#e$e%e&d#„Z'dS($sImplementation of JSONEncoder
iÿÿÿÿN(tDecimalcCs=y$ddlm}|j|jfSWntk
r8dSXdS(Niÿÿÿÿ(t	_speedups(NN(t
simplejsonRtencode_basestring_asciitmake_encodertImportErrortNone(R((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyt_import_speedupss

(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	s\u2028u
s\u2029u
i s\u%04xcCsWt|tƒr6tj|ƒdk	r6|jdƒ}nd„}dtj||ƒdS(s5Return a JSON representation of a Python string

    sutf-8cSst|jdƒS(Ni(t
ESCAPE_DCTtgroup(tmatch((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pytreplace*su"N(t
isinstancetstrtHAS_UTF8tsearchRtdecodetESCAPEtsub(tsR
((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pytencode_basestring$s$	cCs]t|tƒr6tj|ƒdk	r6|jdƒ}nd„}dttj||ƒƒdS(sAReturn an ASCII-only JSON representation of a Python string

    sutf-8cSsŽ|jdƒ}yt|SWnltk
r‰t|ƒ}|dkrNd|fS|d8}d|d?d@B}d|d@B}d||fSnXdS(	Niis\u%04xiØi
iÿiÜs\u%04x\u%04x(RR
tKeyErrortord(RRtnts1ts2((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyR
5s

R	N(RRRRRRtESCAPE_ASCIIR(RR
((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pytpy_encode_basestring_ascii/s$	tJSONEncoderc
BseeZdZdZdZeeeeeddddeeed„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, 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-8c

CsÑ||_||_||_||_||_|
|_||_||_t|t	t
fƒrjd|}n||_|dk	r”|\|_
|_n|dk	r¬d|_
n|	dk	rÄ|	|_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 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.

        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.
        t t,N(tskipkeystensure_asciitcheck_circulart	allow_nant	sort_keystuse_decimaltnamedtuple_as_objectttuple_as_arrayRtinttlongtindentRtitem_separatort
key_separatortdefaulttencoding(
tselfR!R"R#R$R%R+t
separatorsR/R.R&R'R(((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyt__init__js$;								
	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(R0to((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyR.¸scCsÕt|tƒrut|tƒrU|j}|dk	rU|dkrU|j|ƒ}qUn|jrht|ƒSt|ƒSn|j	|dt
ƒ}t|ttfƒs®t|ƒ}n|jrÄdj
|ƒSdj
|ƒ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_shottuN(Rt
basestringRR/RRR"RRt
iterencodetTruetlistttupletjoin(R0R5t	_encodingtchunks((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pytencodeÌs		
	

	
cCsS|jri}nd}|jr*t}nt}|jdkrT||jd„}n|jtttd„}i}|råt	dk	rå|j
dkråt	||j||j
|j|j
|j|j|j||j|j|jƒ
}nKt||j||j
||j|j
|j|j||j|j|jƒ
}z||dƒSWd|jƒ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-8cSs+t|tƒr!|j|ƒ}n||ƒS(N(RRR(R5t
_orig_encoderR>((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyt_encoderýscSsl||krd}n4||kr*d}n||kr?d}n
||ƒS|shtdt|ƒƒ‚n|S(NtNaNtInfinitys	-Infinitys2Out of range float values are not JSON compliant: (t
ValueErrorR4(R5R$t_reprt_inft_neginfttext((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pytfloatstrs			
iN(R#RR"RRR/R$t
FLOAT_REPRRtc_make_encoderR+R.R-R,R%R!R&R'R(t_make_iterencodetclear(R0R5R6tmarkersRBRJtkey_memot_iterencode((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyR9ês4
				N(t__name__t
__module__t__doc__R,R-tFalseR:RR2R.R@R9(((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyRKs	J		tJSONEncoderForHTMLcBs#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. &amp;) because they are not expanded
    within <script> tags.
    cCs9|j|tƒ}|jr(dj|ƒSdj|ƒSdS(NR7u(R9R:R"R=(R0R5R?((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyR@6s	
ccsktt|ƒj||ƒ}xI|D]A}|jddƒ}|jddƒ}|jddƒ}|Vq"WdS(Nt&s\u0026t<s\u003ct>s\u003e(tsuperRVR9R
(R0R5R6R?tchunk((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyR9?s
(RRRSRTR@RUR9(((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyRV-s		cs‡‡‡‡‡‡‡‡‡	‡
‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡fd†‰	‡‡‡‡‡‡‡‡‡‡	‡‡
‡‡‡
‡‡‡‡‡‡‡‡‡‡‡‡‡fd†‰‡‡‡‡‡‡‡‡‡	‡
‡‡‡‡‡‡‡‡‡‡‡‡‡‡fd†‰ˆS(Nc3s·|sdVdSˆdk	rOˆ|ƒ}|ˆkrBˆdƒ‚n|ˆ|<nd}ˆdk	r|d7}dˆ|}ˆ
|}||7}nd}ˆ
}ˆ}xÍ|D]Å}|r¾ˆ}n|}ˆ|ˆ	ƒrå|ˆ|ƒVq©|dkrý|dVq©|ˆkr|dVq©|ˆkr-|dVq©ˆ|ˆˆfƒrT|ˆ|ƒVq©ˆ|ˆƒru|ˆ|ƒVq©ˆrœˆ|ˆƒrœ|ˆ|ƒVq©|Vˆ|ˆƒrˆ||ƒ}n–ˆo×t|d	dƒ}	|	rt|	ƒrˆ
|	ƒ|ƒ}nWˆr(ˆ|ˆƒr(ˆ||ƒ}n0ˆ|ˆƒrIˆ
||ƒ}nˆ||ƒ}x|D]}
|
Vq_Wq©W|dk	r˜|d8}dˆ|Vnd
Vˆdk	r³ˆ|=ndS(Ns[]sCircular reference detectedt[is
tnullttruetfalset_asdictt](Rtgetattrtcallable(tlstt_current_indent_leveltmarkeridtbuftnewline_indentt	separatortfirsttvalueR?R`R[(t_namedtuple_as_objectRBR)tfloatt	_floatstrRORtidt_iterencode_listR8t_item_separatorR*tdictt_iterencode_dictR:REt_use_decimalR<Rt_indentRUt_tuple_as_arrayR;RRQ(s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyRp\sn




		


c3s’|sdVdSˆ
dk	rOˆ|ƒ}|ˆ
krBˆdƒ‚n|ˆ
|<ndVˆdk	rŠ|d7}dˆ|}ˆ|}|Vnd}ˆ}ˆ}ˆrÄ|jƒ}|jdd„ƒn|jƒ}xz|D]r\}}ˆ|ˆƒrõn§ˆ|ˆƒrˆ|ƒ}n‰|ˆkr(d}nt|ˆkr=d	}n_|dkrRd
}nJˆ|ˆˆfƒrvˆ|ƒ}n&ˆr‚q×ntdt|ƒdƒ‚|r«ˆ}n|Vˆ
|ƒVˆVˆ|ˆƒr݈
|ƒVq×|dkrñd
Vq×|ˆkrdVq×|ˆkrd	Vq׈|ˆˆfƒr<ˆ|ƒVq׈|ˆƒrYˆ|ƒVq׈r|ˆ|ˆƒr|ˆ|ƒVq׈|ˆƒrˆ	||ƒ}	n–ˆo²t|d
dƒ}
|
rÜt|
ƒr܈|
ƒ|ƒ}	nWˆrˆ|ˆƒrˆ	||ƒ}	n0ˆ|ˆƒr$ˆ||ƒ}	nˆ||ƒ}	x|	D]}|Vq:Wq×W|dk	rs|d8}dˆ|VndVˆ
dk	rŽˆ
|=ndS(Ns{}sCircular reference detectedt{is
tkeycSs|dS(Ni((tkv((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyt<lambda>¯sR^R_R]skey s is not a stringR`t}(Rtitemstsortt	iteritemsR3R4RbRc(tdctReRfRhR,RjR|RxRkR?R`R[(RlRut_key_separatorR)RmRnR*RRoRpRBR8RqROt
_sort_keysRrRst	_skipkeysR:RERtR<RRURvR;RRQ(s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyRsšs–


					


c3s)ˆ|ˆ	ƒrˆ|ƒVn|dkr1dVnô|ˆkrEdVnà|ˆkrYdVn̈|ˆˆ
fƒr|ˆ|ƒVn©ˆ|ˆƒr™ˆ|ƒVnŒˆ|ˆƒrÊxzˆ||ƒD]}|Vq¸Wn[ˆoßt|ddƒ}|rt|ƒrx.ˆ|ƒ|ƒD]}|VqWnˆrPˆ|ˆƒrPxôˆ||ƒD]}|Vq>WnÕˆ|ˆƒrxÈ||ƒD]}|VqoWn¤ˆr¤ˆ|ˆƒr¤ˆ|ƒVnˆdk	räˆ|ƒ}|ˆkr׈dƒ‚n|ˆ|<nˆ
|ƒ}xˆ||ƒD]}|VqWˆdk	r%ˆ|=ndS(NR]R^R_R`sCircular reference detected(RRbRc(R5ReR[R`Rf(RlRBR)RmRnRORRoRpR8R*RrRst_defaultR:RERtR<RRURvR;RRQ(s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyRQðsJ
	((RORƒRBRuRnR€RqRR‚R6RtRlRvRUR:RER8RRrRmRoR)RR;R*RR<((RlRBR€R)RmRnR*RRoRpR8RqRORRrRsRƒR‚R:RERtR<RRuRURvR;RRQs6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyRMHsW>`VT)((RTtretdecimalRRtc_encode_basestring_asciiRLtsimplejson.decoderRtcompileRRRR
trangetit
setdefaulttchrR4RKRRRtobjectRRVRUR:RER8RrRmRoR)RR;R*RR<RM(((s6/usr/lib/python2.7/dist-packages/simplejson/encoder.pyt<module>sP	
!		â

Youez - 2016 - github.com/yon3zu
LinuXploit