tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
K\¬Qc@sdZddlZddlZddlmZmZmZmZmZm    Z    m
Z
m Z m Z d„Z defd„ƒ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.
 
iÿÿÿÿN(    t_warn_unhandled_exceptiont FileCookieJart    LoadErrortCookietMISSING_FILENAME_TEXTtjoin_header_wordstsplit_header_wordstiso2timet    time2isozcCs·|j|jfd|jfd|jfg}|jd k    rU|jd|jfƒn|jrn|jdƒn|jr‡|jdƒn|j    r |jdƒn|j
r¹|jdƒn|j rç|jdt t |j ƒƒfƒn|jr|jdƒn|jr"|jd
|jfƒn|jrD|jd |jfƒn|jjƒ}|jƒx.|D]&}|j|t|j|ƒfƒqdW|jd t|jƒ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(R N(R N(RN(ssecureN(sdiscardN(tnametvalueR    R
R tNonetappendtpath_specifiedtport_specifiedtdomain_initial_dotRRRtfloatRRt comment_urlt_resttkeystsorttstrRR(tcookiethRtk((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_LWPCookieJar.pytlwp_cookie_strs8                                     
 $t LWPCookieJarcBs8eZdZeed„Zdeed„Zd„ZRS(sZ
    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€tjƒ}g}xW|D]O}| r5|jr5qn| rQ|j|ƒrQqn|jdt|ƒƒqWdj|dgƒS(sžReturn cookies as a string of "\n"-separated "Set-Cookie3" headers.
 
        ignore_discard and ignore_expires: see docstring for FileCookieJar.save
 
        sSet-Cookie3: %ss
t(ttimeRt
is_expiredRR%tjoin(tselftignore_discardtignore_expirestnowtrR"((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_LWPCookieJar.pyt
as_lwp_str>s  cCs|dkr6|jdk    r'|j}q6ttƒ‚nt|dƒ}z*|jdƒ|j|j||ƒƒWd|jƒXdS(Ntws#LWP-Cookies-2.0
(Rtfilenamet
ValueErrorRtopentwriteR0tclose(R+R2R,R-tf((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_LWPCookieJar.pytsaveNs   cCs
|jƒ}tj|j|ƒs:d|}t|ƒ‚ntjƒ}d}d}    d}
yjxc|jƒ} | dkrzPn| j|ƒsq^n| t|ƒjƒ} xt    | gƒD]} | d\} }i}i}x|    D]}t
||<qÞWx«| dD]Ÿ\}}|dk    r$|j ƒ}nd}||
ksB||    krK|}n||    kry|dkrlt }n|||<qý||
kr’|||<qý|||<qýW|j}|d ƒ}|dƒ}|dk    rÜt|ƒ}n|dkrñt }n|d ƒ}|jdƒ}t|dƒ| ||d    ƒ|dƒ|||dƒ|d
ƒ|dƒ|dƒ|||d ƒ|dƒ|ƒ}| r‘|jr‘qµn| r­|j|ƒr­qµn|j|ƒqµWq^WnAtk
r؂n.tk
rtƒtd|| fƒ‚nXdS(Ns5%r does not look like a Set-Cookie3 (LWP) format files Set-Cookie3:R R RRRRR R    R
RRRR'iit.s&invalid Set-Cookie3 format file %r: %r(s    port_specs    path_specs
domain_dotssecuresdiscard(sversionsportspathsdomainsexpiresscomments
commenturl(treadlinetretsearchtmagic_reRR(t
startswithtlentstripRtFalseRtlowertTruetgetRRRR)t
set_cookietIOErrort    ExceptionR(R+R7R2R,R-tmagictmsgR.theadert boolean_attrst value_attrstlinetdataRRtstandardtrestR$tvtlcR#RRR
tdomain_specifiedtc((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_LWPCookieJar.pyt _really_load]sŒ                                                 N(    t__name__t
__module__t__doc__RCR0RRAR8RU(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_LWPCookieJar.pyR&1s (RXR(R;t    cookielibRRRRRRRRRR%R&(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_LWPCookieJar.pyt<module> s@