zfc @sdZdZddlTddlmZddlmZmZmZddlZddl Z ddl Z ddl Z ddd d d d d ddg Z dZ dddddgZdZejZdefdYZdefdYZd efdYZdefdYZyddlmZWnek rBeZnXyeWnek rdeZnXdZdZdZdZ d Z!d!Z"d"Z#d#Z$d$Z%d%Z&d&Z'd'Z(d(Z)d)Z*d*Z+d+Z,d,Z-d-Z.d.Z/d/Z0d0Z1d1Z2d2Z3d3Z4d4Z5d5Z6d6Z7d7Z8d8Z9d9Z:d:Z;d;Z<d<Z=d=Z>d>Z?d?Z@d@ZAdAZBdBZCdCZDdDZEdEZFdFZGdGZHdHZIdIZJdJZKdKZLdLZMdMZNdNZOdOZPdPZQdQZRdRZSeCeMeNeOgZTe jUgeVD]ZWe jXdSeWreW^q[Wd fdTYZYdUZZiZ[dVZ\d fdWYZ]dXfdYYZ^ddl_Z`dZZad[Zbydd\lcmdZdWn!ek rdd\ldmdZdnXed]Zeed^Zfd_Zgd`ZdaZheidbkrehndS(csCreate portable serialized representations of Python objects. See module cPickle for a (much) faster implementation. See module copy_reg for a mechanism for registering custom picklers. See module pickletools source for extensive comments. Classes: Pickler Unpickler Functions: dump(object, file) dumps(object) -> string load(file) -> object loads(string) -> object Misc variables: __version__ format_version compatible_formats s$Revision: 72223 $i(t*(tdispatch_table(t_extension_registryt_inverted_registryt_extension_cacheNt PickleErrort PicklingErrortUnpicklingErrortPicklert Unpicklertdumptdumpstloadtloadss2.0s1.0s1.1s1.2s1.3icBseZdZRS(s6A common base class for the other pickling exceptions.(t__name__t __module__t__doc__(((s/usr/lib64/python2.7/pickle.pyR:scBseZdZRS(s]This exception is raised when an unpicklable object is passed to the dump() method. (RRR(((s/usr/lib64/python2.7/pickle.pyR>scBseZdZRS(sThis exception is raised when there is a problem unpickling an object, such as a security violation. Note that other exceptions may also be raised during unpickling, including (but not necessarily limited to) AttributeError, EOFError, ImportError, and IndexError. (RRR(((s/usr/lib64/python2.7/pickle.pyREst_StopcBseZdZRS(cCs ||_dS(N(tvalue(tselfR((s/usr/lib64/python2.7/pickle.pyt__init__Ss(RRR(((s/usr/lib64/python2.7/pickle.pyRRs(t PyStringMapt(t.t0t1t2tFtItJtKtLtMtNtPtQtRtStTtUtVtXtatbtctdt}tetgthtitjtlt]totptqtrtsttt)tutGsI01 sI00 sssssssssssss[A-Z][A-Z0-9_]+$cBseZddZdZdZdZejdZ ejdZ dZ dZ dZ ddddd ZiZd Zeeeds (RFRBtBINFLOATtFLOATRY(RRPRZ((s/usr/lib64/python2.7/pickle.pyt save_floats cCs|jr`t|}|dkr?|jtt||q{|jt|d||n|jtt|d|j|dS(Nis}y|j}|j|Wqot k rd}PqoXqoWt |}|dkr|t x|D]}||qW|t qV|rV||d|tqVqVWdS(Nii( RNRBRFtAPPENDtxranget _BATCHSIZER?tnexttappendt StopIterationRQRtAPPENDS( RtitemsRNRBRnR9ttmpR2R((s/usr/lib64/python2.7/pickle.pyRfs4              cCsQ|j}|jr|tn|tt|j||j|jdS(N(RBRFt EMPTY_DICTRtDICTRURt iteritems(RRPRB((s/usr/lib64/python2.7/pickle.pyt save_dicts     c CsT|j}|j}|jsTx2|D]*\}}|||||tq"WdSt|j}x|dk rOg}x@|D]8}y|j|jWqt k rd}PqXqWt |} | dkr|t x(|D] \}}||||qW|t qf| rf|d\}}|||||tqfqfWdS(Nii( RNRBRFtSETITEMRRR?RRRRQRtSETITEMS( RRRNRBtktvR9RR2R((s/usr/lib64/python2.7/pickle.pyRs:               c CsD|j}|j}|j}|j}t|drY|j}t|t||nd}|t|j r||x|D]}||qW|t n;x|D]}||qW|t |j d|j d|j|y |j}Wntk r|j} nX|} t| ||| |tdS(Nt__getinitargs__s ((R|RCRBRNR{RRQt _keep_aliveRRFtOBJtINSTRRRUt __getstate__tAttributeErrort__dict__R( RRPRRCRBRNRtargtgetstatetstuff((s/usr/lib64/python2.7/pickle.pyt save_insts6                    c Cs|j}|j}|dkr*|j}nt|dd}|dkrZt||}ny*t|tj|}t||}Wn3t t t fk rt d|||fn)X||k rt d|||fn|j dkr{tj||f} | r{| dkr/|tt| nE| dkr]|dt| d@| d?fn|t|d | dSn|t|d |d |j|dS( NRs(Can't pickle %r: it's not found as %s.%ss2Can't pickle %r: it's not the same object as %s.%siiis%c%c%cist}n0yt|}Wntk rmt|}nX|j|dS(Ni( RRRRRRDRAtlongR(Rtdatatval((s/usr/lib64/python2.7/pickle.pytload_ints    cCs$|jtd|jddS(NR2i(RtmloadsR(R((s/usr/lib64/python2.7/pickle.pyt load_binintscCs |jt|jddS(Ni(RRR(R((s/usr/lib64/python2.7/pickle.pyt load_binint1scCs(|jtd|jdddS(NR2is(RR R(R((s/usr/lib64/python2.7/pickle.pyt load_binint2scCs$|jt|jd ddS(Nii(RRR(R((s/usr/lib64/python2.7/pickle.pyt load_longscCs;t|jd}|j|}|jt|dS(Ni(RRRt decode_long(RRR((s/usr/lib64/python2.7/pickle.pyt load_long1scCs?td|jd}|j|}|jt|dS(NR2i(R RRR(RRR((s/usr/lib64/python2.7/pickle.pyt load_long4scCs!|jt|jd dS(Ni(RtfloatR(R((s/usr/lib64/python2.7/pickle.pyt load_floatscCs'|j|d|jdddS(Ns>dii(RR(Rtunpack((s/usr/lib64/python2.7/pickle.pyt load_binfloatscCs|jd }xrdD]a}|j|rt|dksN|j| rZtdn|t|t| !}PqqWtd|j|jddS(Nis"'isinsecure string pickles string-escape(Rt startswithRQtendswithRARtdecode(RtrepR8((s/usr/lib64/python2.7/pickle.pyt load_strings "  cCs3td|jd}|j|j|dS(NR2i(R RR(RRQ((s/usr/lib64/python2.7/pickle.pytload_binstringscCs$|jt|jd ddS(Nisraw-unicode-escape(RRR(R((s/usr/lib64/python2.7/pickle.pyt load_unicodescCs<td|jd}|jt|j|ddS(NR2isutf-8(R RRR(RRQ((s/usr/lib64/python2.7/pickle.pytload_binunicodescCs/t|jd}|j|j|dS(Ni(RRR(RRQ((s/usr/lib64/python2.7/pickle.pytload_short_binstringscCs1|j}t|j|dg|j|)dS(Ni(RttupleR(RR((s/usr/lib64/python2.7/pickle.pyt load_tuples cCs|jjddS(N((RR(R((s/usr/lib64/python2.7/pickle.pytload_empty_tuplescCs|jdf|jds cCsC|jd }|jd }|j||}|j|dS(Ni(RR2R(RRRR((s/usr/lib64/python2.7/pickle.pyt load_globalEscCs&t|jd}|j|dS(Ni(RRt get_extension(RR((s/usr/lib64/python2.7/pickle.pyt load_ext1LscCs.td|jdd}|j|dS(NR2is(R RR7(RR((s/usr/lib64/python2.7/pickle.pyt load_ext2QscCs*td|jd}|j|dS(NR2i(R RR7(RR((s/usr/lib64/python2.7/pickle.pyt load_ext4VscCsg}tj||}||k r5|j|dStj|}|s]td|n|j|}|t|<|j|dS(Nsunregistered extension code %d(RR^RRRAR2(RRtnilRPR((s/usr/lib64/python2.7/pickle.pyR7[s   cCs*t|tj|}t||}|S(N(RRRRi(RRRRR((s/usr/lib64/python2.7/pickle.pyR2hs  cCs9|j}|j}|d}||}||dRR?tDUPR@R]RAR[RBR\RCRXRDRVRERWRGRRIRRKRRLRRTRRURRVRO(((s/usr/lib64/python2.7/pickle.pyR As                                                                                                        %    R,cBseZRS((RR(((s/usr/lib64/python2.7/pickle.pyR,scCs|dkrdS|dkrt|}d|jd}t||}|d@rfd|d}qtt|dddkrtd |d}qtnt| }d|jd}t||}|d@r|d7}n|d }|d |>7}t|}d|jd}t||}||krJd d |||d}nt|dddkrtd|d}n|jdr|dd!}n |d}tj|}|dddS(sEncode a long to a two's complement little-endian binary string. Note that 0L is a special case, returning an empty string, to save a byte in the LONG1 pickling context. >>> encode_long(0L) '' >>> encode_long(255L) '\xff\x00' >>> encode_long(32767L) '\xff\x7f' >>> encode_long(-256L) '\x00\xff' >>> encode_long(-32768L) '\x00\x80' >>> encode_long(-128L) '\x80' >>> encode_long(127L) '\x7f' >>> iRwiRit0x0iit0x00ilt0xRt0xffiN(thexRRQRDt _binasciit unhexlify(Rntashext njunkcharstnibblestnbitst newnibblestbinary((s/usr/lib64/python2.7/pickle.pyRs:           cCspt|}|dkrdStj|ddd}t|d}|ddkrl|d|d>8}n|S( s\Decode a long from a two's complement little-endian binary string. >>> decode_long('') 0L >>> decode_long("\xff\x00") 255L >>> decode_long("\xff\x7f") 32767L >>> decode_long("\x00\xff") -256L >>> decode_long("\x00\x80") -32768L >>> decode_long("\x80") -128L >>> decode_long("\x7f") 127L ilNiisli(RQR`thexlifyR(R tnbytesRbR((s/usr/lib64/python2.7/pickle.pyR<s  (tStringIOcCst||j|dS(N(RR (RPRHRI((s/usr/lib64/python2.7/pickle.pyR _scCs)t}t||j||jS(N(RjRR tgetvalue(RPRIRH((s/usr/lib64/python2.7/pickle.pyR bs cCst|jS(N(R R (RH((s/usr/lib64/python2.7/pickle.pyR gscCst|}t|jS(N(RjR R (RuRH((s/usr/lib64/python2.7/pickle.pyR js cCsddl}|jS(Ni(tdoctestttestmod(Rl((s/usr/lib64/python2.7/pickle.pyt_testps R(jRt __version__ttypestcopy_regRRRRtmarshalRRtret__all__tformat_versiontcompatible_formatsR@R R t ExceptionRRRRtorg.python.coreRRR?Rt NameErrorRRORRRZRRRRRRRRtRsR~RRRRRRRRRRRR]R[RR\RRRRXRVRWRRRRRRRRLR}RRRRWRXRYRRRRRRHtdirRntmatchRRRRR R,tbinasciiR`RRt cStringIORjR R R RnR(((s/usr/lib64/python2.7/pickle.pyts             5f    B