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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
L\¬Qc @südZddddddddd    g    Zd
d lZd
d lZd
d lZd
d lZd
d lZyd
d lZWne    k
r’d
d l
ZnXd
d l Z d
d l m Z eZead „Zee jƒZdZd„ZdZd„ZdddddddgZdddddddd d!d"d#d$g ZgZx!eD]ZejejƒƒqCWed%„Z ed&„Z!ied'6ed(6ed)6ed*6Z"ej#d+ƒZ$d,„Z%d-„Z&ej#d.ƒZ'ej#d/ej(ƒZ)ej#d0ej*ƒZ+d1„Z,ej#d2ej*ƒZ-d3„Z.d4„Z/ej#d5ƒZ0ej#d6ƒZ1ej#d7ƒZ2ej#d8ƒZ3d9„Z4ej#d:ƒZ5d;„Z6d<„Z7d=„Z8ej#d>ƒZ9d?„Z:d@„Z;dA„Z<dB„Z=ej#dCƒZ>dD„Z?dE„Z@dF„ZAdG„ZBdHZCej#dIƒZDdJ„ZEdK„ZFdL„ZGdM„ZHdfdN„ƒYZIdfdO„ƒYZJdeJfdP„ƒYZKdQ„ZLdR„ZMdSfdT„ƒYZNdfdU„ƒYZOdePfdV„ƒYZQdeOfdW„ƒYZRd
dXlSmTZTmUZUd
dYlVmWZWd S(ZsªHTTP cookie handling for web clients.
 
This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.
 
Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Python attributes.
 
Class diagram (note that BSDDBCookieJar and the MSIE* classes are not
distributed with the Python standard library, but are available from
http://wwwsearch.sf.net/):
 
                        CookieJar____
                        /     \      \
            FileCookieJar      \      \
             /    |   \         \      \
 MozillaCookieJar | LWPCookieJar \      \
                  |               |      \
                  |   ---MSIEBase |       \
                  |  /      |     |        \
                  | /   MSIEDBCookieJar BSDDBCookieJar
                  |/
               MSIECookieJar
 
tCookiet    CookieJart CookiePolicytDefaultCookiePolicyt FileCookieJart LWPCookieJartlwp_cookie_strt    LoadErrortMozillaCookieJariÿÿÿÿN(ttimegmcGs;ts
dSts.ddl}|jdƒantj|ŒS(Niÿÿÿÿt    cookielib(tdebugtloggertloggingt    getLogger(targsR ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_debug+s  sQa filename was not supplied (nor was the CookieJar instance initialised with one)cCsgddl}ddl}ddl}|jƒ}|jd|ƒ|jƒ}|jd|ddƒdS(Niÿÿÿÿscookielib bug!
%st
stackleveli(twarningst    tracebacktStringIOt    print_exctNonetgetvaluetwarn(RRRtftmsg((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_warn_unhandled_exception9s
$  i²c CsÆ|d \}}}}}}|tkr¾d|ko?dknr¾d|ko[dknr¾d|kowdknr¾d|ko“dknr¾d|ko¯dknr¾t|ƒSdSdS(    Niii iiii;i=(t
EPOCH_YEARR    R(ttttyeartmonthtmdaythourtmintsec((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_timegmHs
DT
tMontTuetWedtThutFritSattSuntJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDeccCsZ|dkrtjƒ}ntj|ƒd \}}}}}}d||||||fS(sHReturn a string representing time in seconds since epoch, t.
 
    If the function is called without an argument, it will use the current
    time.
 
    The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ",
    representing Universal Time (UTC, aka GMT).  An example of this format is:
 
    1994-11-24 08:49:37Z
 
    is%04d-%02d-%02d %02d:%02d:%02dZN(Rttimetgmtime(ttRtmonR R!R"R#((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt    time2isozVs
%cCsl|dkrtjƒ}ntj|ƒd \}}}}}}}dt||t|d||||fS(sðReturn a string representing time in seconds since epoch, t.
 
    If the function is called without an argument, it will use the current
    time.
 
    The format of the returned string is like this:
 
    Wed, DD-Mon-YYYY HH:MM:SS GMT
 
    is"%s %02d-%s-%04d %02d:%02d:%02d GMTiN(RR8R9tDAYStMONTHS(R:RR;R R!R"R#twday((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt time2netscapegs
(tGMTtUTCtUTtZs^([-+])?(\d\d?):?(\d\d)?$cCsžd}|tkrd}ntj|ƒ}|ršdt|jdƒƒ}|jdƒrx|dt|jdƒƒ}n|jdƒdkrš| }qšn|S(Niiiii<it-(Rt    UTC_ZONESt TIMEZONE_REtsearchtinttgroup(ttztoffsettm((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytoffset_from_tz_string{s       c    Csýytj|jƒƒd}Wn_tk
r~yt|ƒ}Wntk
rQdSXd|koidknrw|}qdSnX|dkr”d}n|dkr©d}n|dkr¾d}nt|ƒ}t|ƒ}t|ƒ}t|ƒ}t|ƒ}|dkr‚tjtjƒƒd}|d}    |}
|||    }|    |
}    t|    ƒdkr‚|    dkrr|d}q|d}q‚nt    |||||||fƒ} | dk    rù|dkrÄd}n|j
ƒ}t |ƒ} | dkrìdS| | } n| S(Nii iièidi2RB( t MONTHS_LOWERtindextlowert
ValueErrorRIRR8t    localtimetabsR$tupperRN( tdayR;tyrthrR"R#RKtimontcur_yrRMttmpR:RL((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt    _str2time‰sR                        
 
 !          sV^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$s+^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)[a-z]*,?\s*sÒ^
    (\d\d?)            # day
       (?:\s+|[-\/])
    (\w+)              # month
        (?:\s+|[-\/])
    (\d+)              # year
    (?:
          (?:\s+|:)    # separator before clock
       (\d\d?):(\d\d)  # hour:min
       (?::(\d\d))?    # optional seconds
    )?                 # optional clock
       \s*
    ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+)? # timezone
       \s*
    (?:\(\w+\))?       # ASCII representation of timezone in parens.
       \s*$c Cs4tj|ƒ}|r’|jƒ}tj|djƒƒd}t|dƒ|t|dƒt|dƒt|dƒt|dƒf}t|ƒS|j    ƒ}t
j d|dƒ}d    gd\}}}}}}    }
t j|ƒ}|d    k    r|jƒ\}}}}}}    }
nd    St||||||    |
ƒS(
sÕReturns time in seconds since epoch of time represented by a string.
 
    Return value is an integer.
 
    None is returned if the format of str is unrecognized, the time is outside
    the representable range, or the timezone string is not recognized.  If the
    string contains no timezone, UTC is assumed.
 
    The timezone in the string may be numerical (like "-0800" or "+0100") or a
    string timezone (like "UTC", "GMT", "BST" or "EST").  Currently, only the
    timezone strings equivalent to UTC (zero offset) are known to the function.
 
    The function loosely parses the following formats:
 
    Wed, 09 Feb 1994 22:23:32 GMT       -- HTTP format
    Tuesday, 08-Feb-94 14:15:29 GMT     -- old rfc850 HTTP format
    Tuesday, 08-Feb-1994 14:15:29 GMT   -- broken rfc850 HTTP format
    09 Feb 1994 22:23:32 GMT            -- HTTP format (no weekday)
    08-Feb-94 14:15:29 GMT              -- rfc850 format (no weekday)
    08-Feb-1994 14:15:29 GMT            -- broken rfc850 format (no weekday)
 
    The parser ignores leading and trailing whitespace.  The time may be
    absent.
 
    If the year is given with only 2 digits, the function will select the
    century that makes the year closest to the current date.
 
    iiiiiitiN(tSTRICT_DATE_RERHtgroupsRORPRQRItfloatR$tlstript
WEEKDAY_REtsubRtLOOSE_HTTP_DATE_RER\( ttextRMtgR;RRVRWRXR"R#RK((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt    http2timeÔs -
 " $sÆ^
    (\d{4})              # year
       [-\/]?
    (\d\d?)              # numerical month
       [-\/]?
    (\d\d?)              # day
   (?:
         (?:\s+|[-:Tt])  # separator before clock
      (\d\d?):?(\d\d)    # hour:min
      (?::?(\d\d(?:\.\d*)?))?  # optional seconds (and fractional)
   )?                    # optional clock
      \s*
   ([-+]?\d\d?:?(:?\d\d)?
    |Z|z)?               # timezone  (Z is "zero meridian", i.e. GMT)
      \s*$c
Cs|jƒ}dgd\}}}}}}}tj|ƒ}|dk    rp|jƒ\}}}}}}}}    ndSt|||||||ƒS(sv
    As for http2time, but parses the ISO 8601 formats:
 
    1994-02-03 14:15:29 -0100    -- ISO 8601 format
    1994-02-03 14:15:29          -- zone is optional
    1994-02-03                   -- only date
    1994-02-03T14:15:29          -- Use T as separator
    19940203T141529Z             -- ISO 8601 compact format
    19940203                     -- only date
 
    iN(RaRt ISO_DATE_RERHR_R\(
ReRVR;RWRXR"R#RKRMt_((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytiso2times " 'cCs+|jdƒ\}}|j| |j|S(s)Return unmatched part of re.Match object.i(tspantstring(tmatchtstarttend((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt    unmatched=ss^\s*([^=\s;,]+)s&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"s^\s*=\s*([^\s;,]*)s\\(.)c
Csºt|tƒ st‚g}x—|D]}|}g}xd|r›tj|ƒ}|rt|ƒ}|jdƒ}tj|ƒ}|r³t|ƒ}|jdƒ}tj    d|ƒ}nEt
j|ƒ}|ròt|ƒ}|jdƒ}|j ƒ}nd}|j ||fƒq8|jƒjdƒrR|jƒd}|rI|j |ƒng}q8tjdd|ƒ\}}    |    dks’td|||fƒ‚|}q8W|r#|j |ƒq#q#W|S(    smParse header values into a list of lists containing key,value pairs.
 
    The function knows how to deal with ",", ";" and "=" as well as quoted
    values after "=".  A list of space separated tokens are parsed as if they
    were separated by ";".
 
    If the header_values passed as argument contains multiple values, then they
    are treated as if they were a single value separated by comma ",".
 
    This means that this function is useful for parsing header fields that
    follow this syntax (BNF as from the HTTP/1.1 specification, but we relax
    the requirement for tokens).
 
      headers           = #header
      header            = (token | parameter) *( [";"] (token | parameter))
 
      token             = 1*<any CHAR except CTLs or separators>
      separators        = "(" | ")" | "<" | ">" | "@"
                        | "," | ";" | ":" | "\" | <">
                        | "/" | "[" | "]" | "?" | "="
                        | "{" | "}" | SP | HT
 
      quoted-string     = ( <"> *(qdtext | quoted-pair ) <"> )
      qdtext            = <any TEXT except <">>
      quoted-pair       = "\" CHAR
 
      parameter         = attribute "=" value
      attribute         = token
      value             = token | quoted-string
 
    Each header is represented by a list of key/value pairs.  The value for a
    simple token (not part of a parameter) is None.  Syntactically incorrect
    headers will not necessarily be parsed as you would want.
 
    This is easier to describe with some examples:
 
    >>> split_header_words(['foo="bar"; port="80,81"; discard, bar=baz'])
    [[('foo', 'bar'), ('port', '80,81'), ('discard', None)], [('bar', 'baz')]]
    >>> split_header_words(['text/html; charset="iso-8859-1"'])
    [[('text/html', None), ('charset', 'iso-8859-1')]]
    >>> split_header_words([r'Basic realm="\"foo\bar\""'])
    [[('Basic', None), ('realm', '"foobar"')]]
 
    is\1t,s^[=\s;]*R]is&split_header_words bug: '%s', '%s', %sN(t
isinstancet
basestringtAssertionErrortHEADER_TOKEN_RERHRpRJtHEADER_QUOTED_VALUE_REtHEADER_ESCAPE_RERctHEADER_VALUE_REtrstripRtappendRat
startswithtretsubn(
t header_valuestresultRet    orig_texttpairsRMtnametvaluetnon_junkt nr_junk_chars((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytsplit_header_wordsFsF-            
s([\"\\])cCs½g}x§|D]Ÿ}g}xq|D]i\}}|dk    r|tjd|ƒsitjd|ƒ}d|}nd||f}n|j|ƒq W|r |jdj|ƒƒq q Wdj|ƒS(s»Do the inverse (almost) of the conversion done by split_header_words.
 
    Takes a list of lists of (key, value) pairs and produces a single header
    value.  Attribute values are quoted if needed.
 
    >>> join_header_words([[("text/plain", None), ("charset", "iso-8859/1")]])
    'text/plain; charset="iso-8859/1"'
    >>> join_header_words([[("text/plain", None)], [("charset", "iso-8859/1")]])
    'text/plain, charset="iso-8859/1"'
 
    s^\w+$s\\\1s"%s"s%s=%ss; s, N(RR|RHtHEADER_JOIN_ESCAPE_RERcRztjoin(tliststheadersRtattrtktv((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytjoin_header_wordsœs    cCs<|jdƒr|d}n|jdƒr8|d }n|S(Nt"iiÿÿÿÿ(R{tendswith(Re((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt _strip_quotesµs
  c Cshd}g}xU|D]M}g}t}x ttjd|ƒƒD]ò\}}|jƒ}|d    krhq>nd
|kr„|d}}    n'tjd |d ƒ\}}    |jƒ}|d kr|jƒ}
|
|krØ|
}n|dkrùt|    ƒ}    t    }n|dkrt
t|    ƒƒ}    qn|j ||    fƒq>W|r|sP|j dƒn|j |ƒqqW|S(s5Ad-hoc parser for Netscape protocol cookie-attributes.
 
    The old Netscape cookie format for Set-Cookie can for instance contain
    an unquoted "," in the expires field, so we have to use this ad-hoc
    parser instead of split_header_words.
 
    XXX This may not make the best possible effort to parse all the crap
    that Netscape Cookie headers contain.  Ronald Tschalar's HTTPClient
    parser is probably better, so could do worse than following that if
    this ever gives any trouble.
 
    Currently, this is also used for parsing RFC 2109 cookies.
 
    texpirestdomaintpathtsecuretversiontportsmax-ages;\s*R]t=s\s*=\s*iit0(sexpiressdomainspathssecuresversionsportsmax-ageN(sversionR™( tFalset    enumerateR|tsplitRyRRaRQR‘tTrueRgRz( t
ns_headerst known_attrsRt    ns_headerRt version_settiitparamRŒRtlc((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytparse_ns_headers¼s: %                  s\.\d+$cCsKtj|ƒrtS|dkr#tS|ddksC|ddkrGtStS(s*Return True if text is a host domain name.R]it.iÿÿÿÿ(tIPV4_RERHRšR(Re((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytis_HDNñs  cCsŽ|jƒ}|jƒ}||kr(tSt|ƒs8tS|j|ƒ}|dks_|dkrctS|jdƒsvtSt|dƒsŠtStS(sýReturn True if domain A domain-matches domain B, according to RFC 2965.
 
    A and B may be host domain names or IP addresses.
 
    RFC 2965, section 1:
 
    Host names can be specified either as an IP address or a HDN string.
    Sometimes we compare one host name with another.  (Such comparisons SHALL
    be case-insensitive.)  Host A's name domain-matches host B's if
 
         *  their host name strings string-compare equal; or
 
         * A is a HDN string and has the form NB, where N is a non-empty
            name string, B has the form .B', and B' is a HDN string.  (So,
            x.y.com domain-matches .Y.com but not Y.com.)
 
    Note that domain-match is not a commutative operation: a.b.c.com
    domain-matches .c.com, but not the reverse.
 
    iÿÿÿÿiR¦i(RQRR¨RštrfindR{(tAtBti((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt domain_matchs    cCstj|ƒrtStS(sdReturn True if text is a sort-of-like a host domain name.
 
    For accepting/blocking domains.
 
    (R§RHRšR(Re((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytliberal_is_HDN'scCs‡|jƒ}|jƒ}t|ƒo-t|ƒsD||kr@tStS|jdƒ}|rl|j|ƒrltS| rƒ||krƒtStS(s\For blocking/accepting domains.
 
    A and B may be host domain names or IP addresses.
 
    R¦(RQR®RRšR{R(RªR«t initial_dot((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytuser_domain_match1s   s:\d+$cCs_|jƒ}tj|ƒd}|dkr@|jddƒ}ntjd|dƒ}|jƒS(sˆReturn request-host, as defined by RFC 2965.
 
    Variation from RFC: returned value is lowercased, for convenient
    comparison.
 
    iR]tHost(t get_full_urlturlparset
get_headert cut_port_reRcRQ(trequestturlthost((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt request_hostFs   cCsLt|ƒ}}|jdƒdkrBtj|ƒ rB|d}n||fS(szReturn a tuple (request-host, effective request-host name).
 
    As defined by RFC 2965, except both are lowercased.
 
    R¦iÿÿÿÿs.local(R¹tfindR§RH(R¶terhntreq_host((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyteff_request_hostVs% cCsJ|jƒ}tj|ƒ}t|jƒ}|jdƒsFd|}n|S(s6Path component of request-URI, as defined by RFC 2965.t/(R²R³turlsplitt escape_pathR”R{(R¶R·tpartsR”((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt request_pathas   cCsr|jƒ}|jdƒ}|dkrh||d}yt|ƒWqntk
rdtd|ƒdSXnt}|S(Nt:iisnonnumeric port: '%s'(tget_hostRºRIRRRRtDEFAULT_HTTP_PORT(R¶R¸R¬R—((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt request_portks    s%/;:@&=+$,!~*'()s%([0-9a-fA-F][0-9a-fA-F])cCsd|jdƒjƒS(Ns%%%si(RJRU(Rm((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytuppercase_escaped_char}scCsIt|tƒr!|jdƒ}ntj|tƒ}tjt|ƒ}|S(sEEscape any invalid characters in HTTP URL, and uppercase all escapes.sutf-8(    RrtunicodetencodeturllibtquotetHTTP_PATH_SAFEtESCAPED_CHAR_RERcRÇ(R”((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRÀs
 
cCsk|jdƒ}|dkrg||d}|jdƒ}t|ƒrg|dks\|dkrgd|Sn|S(sBReturn reach of host h, as defined by RFC 2965, section 1.
 
    The reach R of a host name H is defined as follows:
 
       *  If
 
          -  H is the host domain name of a host; and,
 
          -  H has the form A.B; and
 
          -  A has no embedded (that is, interior) dots; and
 
          -  B has at least one embedded dot, or B is the string "local".
             then the reach of H is .B.
 
       *  Otherwise, the reach of H is H.
 
    >>> reach("www.acme.com")
    '.acme.com'
    >>> reach("acme.com")
    'acme.com'
    >>> reach("acme.local")
    '.local'
 
    R¦iitlocal(RºR¨(thR¬tb((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytreachs $ cCs3t|ƒ}t|t|jƒƒƒs+tStSdS(sÜ
 
    RFC 2965, section 3.3.6:
 
        An unverifiable transaction is to a third-party host if its request-
        host U does not domain-match the reach R of the request-host O in the
        origin transaction.
 
    N(R¹R­RÑtget_origin_req_hostRRš(R¶R¼((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytis_third_party²s
cBsVeZdZed„Zd„Zdd„Zd„Zdd„Z    d„Z
d„Z RS(    sÐHTTP Cookie.
 
    This class represents both Netscape and RFC 2965 cookies.
 
    This is deliberately a very simple class.  It just holds attributes.  It's
    possible to construct Cookie instances that don't comply with the cookie
    standards.  CookieJar.make_cookies is the factory function for Cookie
    objects -- it deals with cookie parsing, supplying defaults, and
    normalising to the representation used in this class.  CookiePolicy is
    responsible for checking them to see whether they should be accepted from
    and returned to the server.
 
    Note that the port may be present in the headers, but unspecified ("Port"
    rather than"Port=80", for example); if this is the case, port is None.
 
    cCs    |dk    rt|ƒ}n| dk    r6t| ƒ} n|dkr]|tkr]tdƒ‚n||_||_||_||_||_|j    ƒ|_
||_ ||_ |    |_ |
|_| |_| |_| |_||_||_||_tj|ƒ|_dS(Ns-if port is None, port_specified must be false(RRIRRRR–R‚RƒR—tport_specifiedRQR“tdomain_specifiedtdomain_initial_dotR”tpath_specifiedR•R’tdiscardtcommentt comment_urltrfc2109tcopyt_rest(tselfR–R‚RƒR—RÔR“RÕRÖR”R×R•R’RØRÙRÚtrestRÛ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt__init__Õs.                                                              cCs ||jkS(N(RÝ(RÞR‚((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pythas_nonstandard_attrÿscCs|jj||ƒS(N(RÝtget(RÞR‚tdefault((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytget_nonstandard_attrscCs||j|<dS(N(RÝ(RÞR‚Rƒ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytset_nonstandard_attrscCsA|dkrtjƒ}n|jdk    r=|j|kr=tStS(N(RR8R’RRš(RÞtnow((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt
is_expireds
 cCsx|jdkrd}n d|j}|j||j}|jdk    rad|j|jf}n    |j}d||fS(NR]RÃs%s=%ss<Cookie %s for %s>(R—RR“R”RƒR‚(RÞtptlimitt    namevalue((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt__str__ s         cCsˆg}x:dD]2}t||ƒ}|jd|t|ƒfƒq W|jdt|jƒƒ|jdt|jƒƒddj|ƒS(NR–R‚RƒR—RÔR“RÕRÖR”R×R•R’RØRÙRÚs%s=%ssrest=%ss
rfc2109=%ss
Cookie(%s)s, (sversionsnamesvaluesportsport_specifiedsdomainsdomain_specifiedsdomain_initial_dotspathspath_specifiedssecuresexpiressdiscardscomments comment_url(tgetattrRztreprRÝRÛRˆ(RÞRR‚R‹((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt__repr__s
!N( t__name__t
__module__t__doc__RšRàRáRRäRåRçRëRî(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRÃs                
cBs2eZdZd„Zd„Zd„Zd„ZRS(s Defines which cookies get accepted from and returned to server.
 
    May also modify cookies, though this is probably a bad idea.
 
    The subclass DefaultCookiePolicy defines the standard rules for Netscape
    and RFC 2965 cookies -- override that if you want a customised policy.
 
    cCs tƒ‚dS(sÄReturn true if (and only if) cookie should be accepted from server.
 
        Currently, pre-expired cookies never get this far -- the CookieJar
        class deletes such cookies itself.
 
        N(tNotImplementedError(RÞtcookieR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytset_ok.scCs tƒ‚dS(sAReturn true if (and only if) cookie should be returned to server.N(Rò(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt    return_ok7scCstS(sMReturn false if cookies should not be returned, given cookie domain.
        (R(RÞR“R¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytdomain_return_ok;scCstS(sKReturn false if cookies should not be returned, given cookie path.
        (R(RÞR”R¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytpath_return_ok@s(RïRðRñRôRõRöR÷(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyR%s
                c Bs#eZdZdZdZdZdZeeBZdde    e
de
e
e    e
ee
e
d„ Z d„Z d„Z d„Zd    „Zd
„Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!RS(sBImplements the standard rules for accepting and returning cookies.iiiic Cs©||_||_||_||_||_||_|    |_|
|_| |_| |_    |dk    rxt |ƒ|_ n    d|_ |dk    rœt |ƒ}n||_ dS(sAConstructor arguments should be passed as keyword arguments only.N((tnetscapetrfc2965trfc2109_as_netscapet hide_cookie2t strict_domaintstrict_rfc2965_unverifiabletstrict_ns_unverifiabletstrict_ns_domaintstrict_ns_set_initial_dollartstrict_ns_set_pathRttuplet_blocked_domainst_allowed_domains( RÞtblocked_domainstallowed_domainsRøRùRúRûRüRýRþRÿRR((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRàPs                                               cCs|jS(s4Return the sequence of blocked domains (as a tuple).(R(RÞ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRqscCst|ƒ|_dS(s$Set the sequence of blocked domains.N(RR(RÞR((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytset_blocked_domainstscCs+x$|jD]}t||ƒr
tSq
WtS(N(RR°RRš(RÞR“tblocked_domain((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt
is_blockedxscCs|jS(s=Return None, or the sequence of allowed domains (as a tuple).(R(RÞ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyR~scCs(|dk    rt|ƒ}n||_dS(s-Set the sequence of allowed domains, or None.N(RRR(RÞR((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytset_allowed_domainss cCs>|jdkrtSx$|jD]}t||ƒrtSqWtS(N(RRRšR°R(RÞR“tallowed_domain((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytis_not_allowed‡s cCsltd|j|jƒ|jd    k    s+t‚x:d
D]2}d|}t||ƒ}|||ƒs2tSq2WtS( sØ
        If you override .set_ok(), be sure to call this method.  If it returns
        false, so should your subclass (assuming your subclass wants to be more
        strict about which cookies to accept).
 
        s - checking cookie %s=%sR–t verifiabilityR‚R”R“R—tset_ok_N(sversionR snamespathsdomainsport(RR‚RƒRRtRìRšR(RÞRóR¶tntfn_nametfn((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRôs 
cCs{|jdkr)td|j|jƒtS|jdkrP|j rPtdƒtS|jdkrw|j rwtdƒtStS(Ns0   Set-Cookie2 without version attribute (%s=%s)is$   RFC 2965 cookies are switched offs$   Netscape cookies are switched off(    R–RRR‚RƒRšRùRøR(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytset_ok_version¢s
 
cCsk|jƒrgt|ƒrg|jdkr>|jr>tdƒtS|jdkrg|jrgtdƒtSntS(Nis>   third-party RFC 2965 cookie during unverifiable transactions>   third-party Netscape cookie during unverifiable transaction(tis_unverifiableRÓR–RýRRšRþR(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytset_ok_verifiability±s
 
cCsB|jdkr>|jr>|jjdƒr>td|jƒtStS(Nit$s'   illegal name (starts with '$'): '%s'(R–RR‚R{RRšR(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt set_ok_name½s
cCsm|jrit|ƒ}|jdks<|jdkri|jri|j|jƒ ritd|j|ƒtSntS(Nis7   path attribute %s is not a prefix of request path %s(    R×RÂR–RR{R”RRšR(RÞRóR¶treq_path((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt set_ok_pathÆs      c Cs…|j|jƒr&td|jƒtS|j|jƒrLtd|jƒtS|jrt|ƒ\}}|j}|jr|jdƒdkr|j    dƒ}|j    dd|ƒ}|dkr||d}||d|!}    |    j
ƒd"krt |ƒdkrtd|ƒtSqn|j dƒr4|d}
n|}
|
j dƒdk} | rs|dkrstd|ƒtS|jdkrÍ|j|ƒ rÍ|j dƒ rÍd|j|ƒ rÍtd||ƒtSn|jdksì|j|j@rt||ƒstd ||ƒtSn|jdks1|j|j@r|t |ƒ  } | j dƒdkr~tj|ƒ r~td!| |ƒtSqntS(#Ns"   domain %s is in user block-lists&   domain %s is not in user allow-listR¦iiitcotactcomtedutorgtnettgovtmilRItaerotbiztcattcooptinfotjobstmobitmuseumR‚tprottravelteus&   country-code second level domain %ss.locals/   non-local domain %s contains no embedded dotsO   effective request-host %s (even with added initial dot) does not end with %ss5   effective request-host %s does not domain-match %ss.   host prefix %s for domain %s contains a dot(scoRRRRRRR sintR!R"scatR$sinfoR&R'R(snameR)R*R+(R    R“RRšR RÕR½RütcountR©RQtlenR{RºR–RRÿtDomainRFC2965MatchR­tDomainStrictNoDotsR§RHR( RÞRóR¶R¼R»R“R¬tjttldtsldtundotted_domaint embedded_dotst host_prefix((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt set_ok_domainÑsf              
 
 
 
 
cCs±|jr­t|ƒ}|dkr*d}n t|ƒ}xt|jjdƒD]F}yt|ƒWntk
r~td|ƒt    SX||krIPqIqIWtd||jƒt    Snt
S(Nt80Rqs   bad port %s (not numeric)s$   request port (%s) not found in %s( RÔRÆRtstrR—RœRIRRRRšR(RÞRóR¶treq_portRè((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt set_ok_port s"               cCsWtd|j|jƒx:d    D]2}d|}t||ƒ}|||ƒstSqWtS(
        If you override .return_ok(), be sure to call this method.  If it
        returns false, so should your subclass (assuming your subclass wants to
        be more strict about which cookies to return).
 
        s - checking cookie %s=%sR–R R•R’R—R“t
return_ok_(sversions verifiabilityssecuresexpiressportsdomain(RR‚RƒRìRšR(RÞRóR¶RRR((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRõ!s     
cCsR|jdkr'|j r'tdƒtS|jdkrN|j rNtdƒtStS(Nis$   RFC 2965 cookies are switched offs$   Netscape cookies are switched off(R–RùRRšRøR(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytreturn_ok_version3s
 
cCsk|jƒrgt|ƒrg|jdkr>|jr>tdƒtS|jdkrg|jrgtdƒtSntS(Nis>   third-party RFC 2965 cookie during unverifiable transactions>   third-party Netscape cookie during unverifiable transaction(RRÓR–RýRRšRþR(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytreturn_ok_verifiability<s
 
cCs-|jr)|jƒdkr)tdƒtStS(Nthttpss(   secure cookie with non-secure request(R•tget_typeRRšR(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytreturn_ok_secureHs
cCs$|j|jƒr tdƒtStS(Ns   cookie expired(Rçt_nowRRšR(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytreturn_ok_expiresNs
cCsu|jrqt|ƒ}|dkr*d}nxD|jjdƒD]}||kr=Pq=q=Wtd||jƒtSntS(NR7Rqs0   request port %s does not match cookie port %s(R—RÆRRœRRšR(RÞRóR¶R9Rè((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytreturn_ok_portTs            c    CsÌt|ƒ\}}|j}|jdkr^|j|j@r^|j r^||kr^tdƒtS|jdkr‘t||ƒ r‘td||ƒtS|jdkrÈd|j    |ƒ rÈtd||ƒtSt
S(NisQ   cookie with unspecified domain does not string-compare equal to request domainsQ   effective request-host name %s does not domain-match RFC 2965 cookie domain %sR¦s;   request-host %s does not match Netscape cookie domain %s( R½R“R–RÿtDomainStrictNonDomainRÕRRšR­RR(RÞRóR¶R¼R»R“((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytreturn_ok_domainbs     
 
#
cCs°t|ƒ\}}|jdƒs.d|}n|jdƒsJd|}n|j|ƒpe|j|ƒsltS|j|ƒrŒtd|ƒtS|j|ƒr¬td|ƒtStS(NR¦s"   domain %s is in user block-lists&   domain %s is not in user allow-list(R½R{RRšR    RR R(RÞR“R¶R¼R»((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRöxs    cCs@td|ƒt|ƒ}|j|ƒs<td||ƒtStS(Ns- checking cookie path=%ss  %s does not path-match %s(RRÂR{RšR(RÞR”R¶R((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyR÷Žs   N("RïRðRñR/RDR.t DomainLiberalt DomainStrictRRRšRàRRR    RR
R RôRRRRR6R:RõR<R=R@RBRCRERöR÷(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRFsL
                                                     ;                                        cCs&|jƒ}|jƒt|j|ƒS(N(tkeystsorttmapRâ(tadictRH((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytvals_sorted_by_key—s 
ccsvt|ƒ}xc|D][}t}y |jWntk
r=n#Xt}xt|ƒD] }|VqQW|s|VqqWdS(sBIterates over nested mapping, depth-first, in sorted order by key.N(RLRštitemstAttributeErrorRt
deepvalues(tmappingtvaluestobjtsubobj((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyROœs        tAbsentcBseZRS((RïRð(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRT¯scBs(eZdZejdƒZejdƒZejdƒZejdƒZejdƒZ    dZ
dd„Z d„Z d    „Zd
„Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdddd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(sŽCollection of HTTP cookies.
 
    You may not need to know about this class: try
    urllib2.build_opener(HTTPCookieProcessor).open(url).
 
    s\Ws([\"\\])s\.?[^.]*s[^.]*s^\.+s^\#LWP-Cookies-(\d+\.\d+)cCs=|dkrtƒ}n||_tjƒ|_i|_dS(N(RRt_policyt
_threadingtRLockt _cookies_lockt_cookies(RÞtpolicy((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRàÁs
      cCs ||_dS(N(RU(RÞRZ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt
set_policyÉscCsÌg}|jj||ƒsgStd|ƒ|j|}xŒ|jƒD]~}|jj||ƒsgqFn||}xP|jƒD]B}|jj||ƒs©tdƒq~ntdƒ|j|ƒq~WqFW|S(Ns!Checking %s for cookies to returns   not returning cookies   it's a match(    RURöRRYRHR÷RQRõRz(RÞR“R¶tcookiestcookies_by_pathR”tcookies_by_nameRó((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_cookies_for_domainÌs   
 
 
cCs=g}x0|jjƒD]}|j|j||ƒƒqW|S(s2Return a list of cookies to be returned to server.(RYRHtextendR_(RÞR¶R\R“((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_cookies_for_requestÞsc    CsÈ|jdd„dtƒt}g}xœ|D]”}|j}|sjt}|dkrj|jd|ƒqjn|jdk    rµ|jj|jƒrµ|dkrµ|j    j
d|jƒ}n    |j}|jdkrà|j|j ƒn|jd|j |fƒ|dkr,|j r&|jd|j ƒn|jjd    ƒr{|j}|j rg|jd    ƒrg|d
}n|jd |ƒn|jdk    rÀd }|jr­|d |j}n|j|ƒqÀq,q,W|S(sÜReturn a list of cookie-attributes to be returned to server.
 
        like ['foo="bar"; $Path="/"', ...]
 
        The $Version attribute is also added when appropriate (currently only
        once per request).
 
        tkeycSs t|jƒS(N(R-R”(targ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt<lambda>ïstreverseis $Version=%ss\\\1s%s=%ss
$Path="%s"R¦is $Domain="%s"s$Ports="%s"N(RIRRšR–RzRƒRt non_word_reRHtquote_reRcR‚R×R”R“R{RÖR—RÔ(    RÞR\R¡tattrsRóR–RƒR“Rè((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt _cookie_attrsås>
      !             
     cCs tdƒ|jjƒzÕttjƒƒ|j_|_|j|ƒ}|j|ƒ}|r‹|j    dƒs‹|j
ddj |ƒƒq‹n|jj rë|jj rë|j    dƒ rëx4|D])}|jdkr»|j
ddƒPq»q»WnWd|jjƒX|jƒdS(s—Add correct Cookie: header to request (urllib2.Request object).
 
        The Cookie2 header is also added unless policy.hide_cookie2 is true.
 
        tadd_cookie_headerRs; tCookie2is $Version="1"N(RRXtacquireRIR8RURARaRit
has_headertadd_unredirected_headerRˆRùRûR–treleasetclear_expired_cookies(RÞR¶R\RhRó((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRj s$
  c
Csg}d}d}x|D]ü}|d \}}t}t}    i}
i} x¦|d D]š\} } | jƒ}||ks‚||kr‹|} n| |kr¬| dkr¬t} n| |
kr¾qRn| dkrù| dkrêtd ƒt}    Pn| jƒ} n| dkr0|rqRn| dkr0tdƒqRq0n| dkrt}yt| ƒ} Wn"tk
rvtdƒt}    PnXd} |j| } n| |ks¥| |krâ| dkrÕ| dkrÕtd| ƒt}    Pn| |
| <qR| | | <qRW|    rüqn|j|||
| fƒqW|S(sReturn list of tuples containing normalised cookie information.
 
        attrs_set is the list of lists of key,value pairs extracted from
        the Set-Cookie or Set-Cookie2 headers.
 
        Tuples are name, value, standard, rest, where name and value are the
        cookie name and value, standard is a dictionary containing the standard
        cookie-attributes (discard, secure, version, expires or max-age,
        domain, path and port) and rest is a dictionary containing the rest of
        the cookie-attributes.
 
        RØR•R–R’smax-ageR“R”R—RÙt
commenturliis%   missing value for domain attributesM   missing or invalid value for expires attribute: treating as session cookies?   missing or invalid (non-numeric) value for max-age attributes!   missing value for %s attribute(sdiscardssecure(sversionsexpiressmax-agesdomainspathsportscommentRqN(sportscommentRq(    RšRQRRRRIRRRARz(RÞt    attrs_sett cookie_tuplest boolean_attrst value_attrst cookie_attrsR‚Rƒt max_age_sett
bad_cookietstandardRßRŒRR¤((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_normalized_cookie_tuplesAsl  
            
 
      
   cCsî|\}}}}|jdtƒ}|jdtƒ}|jdtƒ}    |jdtƒ}
|jddƒ} | dk    r yt| ƒ} Wq tk
rœdSXn|jdtƒ} |jdtƒ} |jddƒ}|jd    dƒ}|tk    r|d
krt}t|ƒ}nrt}t|ƒ}|j    d ƒ}|d krl| d kr[|| }ql||d }nt
|ƒd kr‡d }n|tk    }t}|r·t |j dƒƒ}n|tkrÞt |ƒ\}}|}n|j dƒsúd|}nt}|    tk    rE|    dkr't|ƒ}    qKt}tjdd
|    ƒ}    nd}    |
tkrfd}
t} nQ|
|jkr·y|j|||ƒWntk
rŸnXtd|||ƒdSt| |||    ||||||| |
| |||ƒS(NR“R”R—R’R–R•RØRÙRqR]R¾iÿÿÿÿiiR¦s\s+s2Expiring cookie, domain='%s', path='%s', name='%s'(RâRTRRIRRRšRRÀRÂR©R-tboolR{R½RÆR|RcRAtcleartKeyErrorRR(RÞttupR¶R‚RƒRyRßR“R”R—R’R–R•RØRÙRÚR×R¬RÕRÖR¼R»RÔ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_cookie_from_cookie_tuple¢s‚                              cCsR|j|ƒ}g}x6|D].}|j||ƒ}|r|j|ƒqqW|S(N(RzRRz(RÞRrR¶RsR\R~Ró((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_cookies_from_attrs_setþs cCsst|jddƒ}|dkr1|jj }nx;|D]3}|jdkr8t|_|rkd|_qkq8q8WdS(NRúii(RìRURRùR–RRÛ(RÞR\t rfc2109_as_nsRó((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt_process_rfc2109_cookiess      c Cs…|jƒ}|jdƒ}|jdƒ}|jj}|jj}| rP| sz| r^| sz| rl| sz| r~| r~gSy|jt|ƒ|ƒ}Wntk
rºtƒg}nX|r|ry|jt    |ƒ|ƒ}    Wntk
rtƒg}    nX|j
|    ƒ|rhi}
x*|D]"} d|
| j | j | jf<q$W|
d„} t| |    ƒ}    n|    r|j|    ƒqn|S(sAReturn sequence of Cookie objects extracted from response object.s Set-Cookie2s
Set-CookiecSs"|j|j|jf}||kS(N(R“R”R‚(t    ns_cookietlookupRb((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytno_matching_rfc2965?sN(R%t
getheadersRURùRøR€R†t    ExceptionRR¥R‚RR“R”R‚tfilterR`( RÞtresponseR¶RŠt rfc2965_hdrstns_hdrsRùRøR\t
ns_cookiesR„RóR…((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt make_cookiessB    
 
    cCsj|jjƒzHttjƒƒ|j_|_|jj||ƒrT|j|ƒnWd|jjƒXdS(s-Set a cookie if policy says it's OK to do so.N(    RXRlRIR8RURARôt
set_cookieRo(RÞRóR¶((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytset_cookie_if_okIs  cCs”|j}|jjƒzi|j|kr8i||j<n||j}|j|krdi||j<n||j}|||j<Wd|jjƒXdS(s?Set a cookie, without checking whether or not it should be set.N(RYRXRlR“R”R‚Ro(RÞRótctc2tc3((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRŽVs       cCs§td|jƒƒ|jjƒzrttjƒƒ|j_|_xL|j||ƒD]8}|jj    ||ƒrUtd|ƒ|j
|ƒqUqUWWd|jj ƒXdS(sAExtract cookies from response, where allowable given the request.sextract_cookies: %ss setting cookie: %sN( RR%RXRlRIR8RURARRôRŽRo(RÞR‰R¶Ró((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytextract_cookiescs  cCs¦|dk    rH|dks$|dkr3tdƒ‚n|j|||=nZ|dk    r€|dkrotdƒ‚n|j||=n"|dk    r™|j|=n    i|_dS(sÑClear some cookies.
 
        Invoking this method without arguments will clear all cookies.  If
        given a single argument, only cookies belonging to that domain will be
        removed.  If given two arguments, cookies belonging to the specified
        path within that domain are removed.  If given three arguments, then
        the cookie with the specified name, path and domain is removed.
 
        Raises KeyError if no matching cookie exists.
 
        s8domain and path must be given to remove a cookie by names.domain must be given to remove cookies by pathN(RRRRY(RÞR“R”R‚((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyR|qs       cCs_|jjƒz=x6|D].}|jr|j|j|j|jƒqqWWd|jjƒXdS(s»Discard all session cookies.
 
        Note that the .save() method won't save session cookies anyway, unless
        you ask otherwise by passing a true ignore_discard argument.
 
        N(RXRlRØR|R“R”R‚Ro(RÞRó((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytclear_session_cookiesŒs       'cCsq|jjƒzOtjƒ}x<|D]4}|j|ƒr#|j|j|j|jƒq#q#WWd|jjƒXdS(s”Discard all expired cookies.
 
        You probably don't need to call this method: expired cookies are never
        sent back to the server (provided you're using DefaultCookiePolicy),
        this method is called by CookieJar itself every so often, and the
        .save() method won't save expired cookies anyway (unless you ask
        otherwise by passing a true ignore_expires argument).
 
        N(    RXRlR8RçR|R“R”R‚Ro(RÞRæRó((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRp›s
  'cCs t|jƒS(N(RORY(RÞ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt__iter__®scCs%d}x|D]}|d}q W|S(s#Return number of contained cookies.ii((RÞR¬Ró((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt__len__±s cCsDg}x!|D]}|jt|ƒƒq Wd|jdj|ƒfS(Ns<%s[%s]>s, (RzRít    __class__Rˆ(RÞtrRó((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRî·s cCsDg}x!|D]}|jt|ƒƒq Wd|jdj|ƒfS(Ns<%s[%s]>s, (RzR8R—Rˆ(RÞR˜Ró((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRë¼s N(!RïRðRñR|tcompileRfRgtstrict_domain_ret    domain_retdots_retmagic_reRRàR[R_RaRiRjRzRR€R‚RRRŽR“R|R”RpR•R–RîRë(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyR±s8                 ;    !    a    \                6                                cBseZRS((RïRð(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRÃscBsVeZdZdedd„Zdeed„Zdeed„Zdeed„ZRS(s6CookieJar that can be loaded from and saved to a file.cCs]tj||ƒ|dk    rAy |dWqAtdƒ‚qAXn||_t|ƒ|_dS(s}
        Cookies are NOT loaded from the named file until either the .load() or
        .revert() method is called.
 
        R]sfilename must be string-likeN(RRàRRRtfilenameR{t    delayload(RÞRžRŸRZ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRàÈs      cCs tƒ‚dS(sSave cookies to a file.N(Rò(RÞRžtignore_discardtignore_expires((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytsave×scCsn|dkr6|jdk    r'|j}q6ttƒ‚nt|ƒ}z|j||||ƒWd|jƒXdS(sLoad cookies from a file.N(RRžRRtMISSING_FILENAME_TEXTtopent _really_loadtclose(RÞRžR R¡R((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytloadÛs   cCs´|dkr6|jdk    r'|j}q6ttƒ‚n|jjƒz\tj|jƒ}i|_y|j    |||ƒWn#t
t fk
r||_‚nXWd|jj ƒXdS(sÈClear all cookies and reload cookies from a saved file.
 
        Raises LoadError (or IOError) if reversion is not successful; the
        object's state will not be altered if this happens.
 
        N( RRžRRR£RXRlRÜtdeepcopyRYR§RtIOErrorRo(RÞRžR R¡t    old_state((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pytrevertçs            N(    RïRðRñRRšRàR¢R§R«(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyRÅs  (RR(R(XRñt__all__R|R³RÜR8RÊt    threadingRVt ImportErrortdummy_threadingthttplibtcalendarR    RšR RR RR8t    HTTP_PORTRÅR£RRR$R=R>RORRzRQR<R@RFR™RGRNR\R^tIRbtXRdRgRhRjRpRuRvRxRwR†R‡RŽR‘R¥R§R¨R­R®R°RµR¹R½RÂRÆRÌRÍRÇRÀRÑRÓRRRRLRORTRR©RRt _LWPCookieJarRRt_MozillaCookieJarR(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/cookielib.pyt<module>s       <      
           "        5        8    !        U            4        '    
               
               #    b!ÿR        ÿÿ<