mς %U²Ic@sdZdkZdkZdkZdklZlZlZlZl Z l Z l Z l Z l Z d„Zdefd„ƒYZdS(s΅Load / save to libwww-perl (LWP) format files. Actually, the format is slightly extended from that used by LWP's (libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information not recorded by LWP. It uses the version string "2.0", though really there isn't an LWP Cookies 2.0 format. This indicates that there is extra information in here (domain_dot and # port_spec) while still being compatible with libwww-perl, I hope. N( sreraise_unmasked_exceptionss FileCookieJars LoadErrorsCookiesMISSING_FILENAME_TEXTsjoin_header_wordsssplit_header_wordssiso2times time2isozcCsΙ|i|ifd|ifd|ifg}|id j o|id|ifƒn|i o|idƒn|i o|idƒn|i o|idƒn|i o|idƒn|i o&|idtt|i ƒƒfƒn|io|idƒn|io|id |ifƒn|io|id |ifƒn|iiƒ}|iƒx.|D]&}|i|t|i|ƒfƒqvW|id t|iƒfƒt|gƒS(s“Return string representation of Cookie in an the LWP cookie file format. Actually, the format is extended a bit -- see module docstring. tpathtdomaintportt path_spect port_spect domain_dottsecuretexpirestdiscardtcommentt commenturltversionN(RN(RN(RN(ssecureN(sdiscardN(tcookietnametvalueRRthRtNonetappendtpath_specifiedtport_specifiedtdomain_initial_dotRRt time2isoztfloatRR t comment_urlt_resttkeystsorttktstrR tjoin_header_words(R RRR((t*/data/zmath/lib/python2.4/_LWPCookieJar.pytlwp_cookie_strs6-     &    $t LWPCookieJarcBs8tZdZeed„Zeeed„Zd„ZRS(sY The LWPCookieJar saves a sequence of"Set-Cookie3" lines. "Set-Cookie3" is the format used by the libwww-perl libary, not known to be compatible with any browser, but which is easy to read and doesn't lose information about RFC 2965 cookies. Additional methods as_lwp_str(ignore_discard=True, ignore_expired=True) cCs†tiƒ}g}x]|D]U}| o|ioqn| o|i|ƒoqn|i dt |ƒƒqWdi |dgƒS(sReturn cookies as a string of " "-separated "Set-Cookie3" headers. ignore_discard and ignore_expires: see docstring for FileCookieJar.save sSet-Cookie3: %ss tN( ttimetnowtrtselfR tignore_discardRtignore_expirest is_expiredRRtjoin(R%R&R'R$R R#((Rt as_lwp_str=s cCs…|djo-|idj o |i}q:ttƒ‚nt|dƒ}z*|idƒ|i|i||ƒƒWd|i ƒXdS(Ntws#LWP-Cookies-2.0 ( tfilenameRR%t ValueErrortMISSING_FILENAME_TEXTtopentftwriteR*R&R'tclose(R%R,R&R'R0((RtsaveMs   cCs |iƒ}ti|i|ƒpd|} t | ƒ‚nt i ƒ}d}d}d}y…x~|iƒ}|djoPn|i|ƒpq`n|t|ƒiƒ}x+t|gƒD]}|d\}}h} h}x|D]}t| |R((Rt _really_load\s„                       ( t__name__t __module__t__doc__RKR*RRGR3RT(((RR 0s (RWR"R7tloggingt cookielibRRt FileCookieJarR;ROR.RRCRMRRR (RXRZR;RRMR.RCR7ROR"RRRR R((Rt? s=