config root man

Current Path : /usr/local/lib/python2.5/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/python2.5/cookielib.pyc

hRc@sdZddddddddgZd	d
kZd	d
kZd	d
kZd	d
kZd	d
kZyd	d
kZWne	j
od	d
k
ZnXd	d
kZd	dkl
Z
eZeadZeeiZd
ZdZdZdZdddddddgZddddddddd d!d"d#gZgZx!eD]ZeieiqBWed$Z ed%Z!hed&<ed'<ed(<ed)<Z"ei#d*Z$d+Z%d,Z&ei#d-Z'ei#d.ei(Z)ei#d/ei*Z+d0Z,ei#d1ei*Z-d2Z.d3Z/ei#d4Z0ei#d5Z1ei#d6Z2ei#d7Z3d8Z4ei#d9Z5d:Z6d;Z7ei#d<Z8d=Z9d>Z:d?Z;d@Z<ei#dAZ=dBZ>dCZ?dDZ@dEZAdFZBei#dGZCdHZDdIZEdJZFdKZGdfdLYZHdfdMYZIdeIfdNYZJdOZKdPZLdQfdRYZMdfdSYZNdeOfdTYZPdeNfdUYZQd	dVkRlSZSlTZTd	dWkUlVZVd
S(XsHTTP 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LWPCookieJart	LoadErrortMozillaCookieJariN(ttimegmcGsBtpdSntpddk}|idanti|S(Nit	cookielib(tdebugtloggertloggingt	getLogger(targsR((s%/usr/local/lib/python2.5/cookielib.pyt_debug*ssQa filename was not supplied (nor was the CookieJar instance initialised with one)cCsgddk}ddk}ddk}|i}|id||i}|id|dddS(Niscookielib bug!
%st
stackleveli(twarningst	tracebacktStringIOt	print_exctNonetgetvaluetwarn(RRRtftmsg((s%/usr/local/lib/python2.5/cookielib.pyt_warn_unhandled_exception8s
$icCs|d \}}}}}}|tjod|jo
djnod|jo
djnohd|jo
djnoJd|jo
djno,d|jo
djnot|SndSdS(	Niiiiiii;i=(t
EPOCH_YEARRR(ttttyeartmonthtmdaythourtmintsec((s%/usr/local/lib/python2.5/cookielib.pyt_timegmGs
IZtMontTuetWedtThutFritSattSuntJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDeccCs\|djoti}nti|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(ttRtmonRR R!R"((s%/usr/local/lib/python2.5/cookielib.pyt	time2isozUs

%c	Csn|djoti}nti|d \}}}}}}}dt||t|d||||fS(sReturn 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(RR7R8tDAYStMONTHS(R9RR:RR R!R"twday((s%/usr/local/lib/python2.5/cookielib.pyt
time2netscapefs

(tGMTtUTCtUTtZs^([-+])?(\d\d?):?(\d\d)?$cCsd}|tjo
d}nti|}|oodt|id}|ido!|dt|id}n|iddjo|}qn|S(Niiiii<it-(Rt	UTC_ZONEStTIMEZONE_REtsearchtinttgroup(ttztoffsettm((s%/usr/local/lib/python2.5/cookielib.pytoffset_from_tz_stringzs

!c
Csyti|id}Wnitj
o]yt|}Wntj
odSnXd|jo
djno
|}qdSnX|djo
d}n|djo
d}n|djo
d}nt|}t|}t|}t|}t|}|djotitid}|d}	|}
|||	}|	|
}	t|	djo)|	djo|d}q|d}qnt	|||||||f}|dj	oR|djo
d}n|i
}t|}|djodSn||}n|S(Niiiiidi2RA(tMONTHS_LOWERtindextlowert
ValueErrorRHRR7t	localtimetabsR#tupperRM(
tdayR:tyrthrR!R"RJtimontcur_yrRLttmpR9RK((s%/usr/local/lib/python2.5/cookielib.pyt	_str2timesR	
	









!



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*$cCs;ti|}|o|i}ti|did}t|d|t|dt|dt|dt|df}t|Sn|i	}t
id|d}d	gd\}}}}}}	}
t
i|}|d	j	o%|i\}}}}}}	}
nd	St||||||	|
S(
sReturns 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_RERGtgroupsRNRORPRHtfloatR#tlstript
WEEKDAY_REtsubRtLOOSE_HTTP_DATE_RER[(ttextRLtgR:RRURVRWR!R"RJ((s%/usr/local/lib/python2.5/cookielib.pyt	http2times-"
%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|i}dgd\}}}}}}}ti|}|dj	o(|i\}}}}}}}}	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(R`RtISO_DATE_RERGR^R[(
RdRUR:RVRWR!R"RJRLt_((s%/usr/local/lib/python2.5/cookielib.pytiso2times
"
(cCs+|id\}}|i| |i|S(s)Return unmatched part of re.Match object.i(tspantstring(tmatchtstarttend((s%/usr/local/lib/python2.5/cookielib.pyt	unmatched<ss^\s*([^=\s;,]+)s&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"s^\s*=\s*([^\s;,]*)s\\(.)c
Cst|tptg}x|D]}|}g}xo|ogti|}|ot|}|id}ti|}|o1t|}|id}ti	d|}nHt
i|}|o+t|}|id}|i}nd}|i
||fq:|iido2|id}|o|i
|ng}q:tidd|\}}	|	djptd|||f|}q:W|o|i
|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_RERGRoRItHEADER_QUOTED_VALUE_REtHEADER_ESCAPE_RERbtHEADER_VALUE_REtrstripRtappendR`t
startswithtretsubn(
t
header_valuestresultRdt	orig_texttpairsRLtnametvaluetnon_junkt
nr_junk_chars((s%/usr/local/lib/python2.5/cookielib.pytsplit_header_wordsEsJ-
s([\"\\])cCsg}x|D]}g}xu|D]m\}}|dj	oGtid|p tid|}d|}nd||f}n|i|q W|o|idi|q
q
Wdi|S(sDo 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{RGtHEADER_JOIN_ESCAPE_RERbRytjoin(tliststheadersRtattrtktv((s%/usr/local/lib/python2.5/cookielib.pytjoin_header_wordss
cCsd}g}x|D]}g}t}xBttid|D](\}}|i}|djoq>nd	|jo|d}}	n(tid
|d\}}	|i}|djo|i}
|
|jo
|
}n|d
jo
t}n|djoL|	i	do|	d}	n|	i
do|	d }	nt|	}	qSn|i||	fq>W|o)|p|idn|i|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.

    texpirestdomaintpathtsecuretportsmax-ages;\s*R\t=s\s*=\s*iitversiont"it0(sexpiressdomainspathssecuresportsmax-ageN(sversionR(
tFalset	enumerateR{tsplitRxRR`RPtTrueRztendswithRfRy(t
ns_headerstknown_attrsR~t	ns_headerRtversion_settiitparamRRtlc((s%/usr/local/lib/python2.5/cookielib.pytparse_ns_headerssD







s\.\d+$cCs[ti|otSn|djotSn|ddjp|ddjotSntS(s*Return True if text is a host domain name.R\it.i(tIPV4_RERGRR(Rd((s%/usr/local/lib/python2.5/cookielib.pytis_HDNs
"cCs|i}|i}||jotSnt|ptSn|i|}|djp
|djotSn|idptSnt|dptSntS(sReturn 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.

    iiRi(RPRRRtrfindRz(tAtBti((s%/usr/local/lib/python2.5/cookielib.pytdomain_matchs

cCsti|otSntS(sdReturn True if text is a sort-of-like a host domain name.

    For accepting/blocking domains.

    (RRGRR(Rd((s%/usr/local/lib/python2.5/cookielib.pytliberal_is_HDN scCs|i}|i}t|o
t|p||jotSntSn|id}|o|i|otSn|o||jotSntS(s\For blocking/accepting domains.

    A and B may be host domain names or IP addresses.

    R(RPRRRRzR(RRtinitial_dot((s%/usr/local/lib/python2.5/cookielib.pytuser_domain_match*s
s:\d+$cCsa|i}ti|d}|djo|idd}ntid|d}|iS(sReturn request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    iR\tHost(tget_full_urlturlparset
get_headertcut_port_reRbRP(trequestturlthost((s%/usr/local/lib/python2.5/cookielib.pytrequest_host?s
cCsOt|}}|iddjoti|o|d}n||fS(szReturn a tuple (request-host, effective request-host name).

    As defined by RFC 2965, except both are lowercased.

    Ris.local(RtfindRRG(Rterhntreq_host((s%/usr/local/lib/python2.5/cookielib.pyteff_request_hostOs'cCs|i}ti|d\}}}}|od||f}nt|}tidd|d||f}|idpd|}n|S(s$request-URI, as defined by RFC 2965.is%s;%sR\t/(RRtescape_patht
urlunparseRz(RRRt
parameterstquerytfragtreq_path((s%/usr/local/lib/python2.5/cookielib.pytrequest_pathZs!cCsy|i}|id}|djoG||d}yt|Wqutj
otd|dSquXnt}|S(Nt:iisnonnumeric port: '%s'(tget_hostRRHRQRRtDEFAULT_HTTP_PORT(RRRR((s%/usr/local/lib/python2.5/cookielib.pytrequest_portis


s%/;:@&=+$,!~*'()s%([0-9a-fA-F][0-9a-fA-F])cCsd|idiS(Ns%%%si(RIRT(Rl((s%/usr/local/lib/python2.5/cookielib.pytuppercase_escaped_char{scCsKt|to|id}nti|t}tit|}|S(sEEscape any invalid characters in HTTP URL, and uppercase all escapes.sutf-8(	RqtunicodetencodeturllibtquotetHTTP_PATH_SAFEtESCAPED_CHAR_RERbR(R((s%/usr/local/lib/python2.5/cookielib.pyR}s

cCst|id}|djoT||d}|id}t|o&|djp
|djod|Sqpn|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'

    Riitlocal(RR(thRtb((s%/usr/local/lib/python2.5/cookielib.pytreachs
'cCs8t|}t|t|iptSntSdS(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(RRRtget_origin_req_hostRR(RR((s%/usr/local/lib/python2.5/cookielib.pytis_third_partys
cBsVeZdZedZdZddZdZddZ	dZ
dZRS(	sHTTP 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|dj	ot|}n|dj	ot|}n|djo|tjotdn||_||_||_||_||_|i	|_
||_||_|	|_
|
|_||_||_|
|_||_||_||_ti||_dS(Ns-if port is None, port_specified must be false(RRHRRQRRRRtport_specifiedRPRtdomain_specifiedtdomain_initial_dotRtpath_specifiedRRtdiscardtcommenttcomment_urltrfc2109tcopyt_rest(tselfRRRRRRRRRRRRRRRtrestR((s%/usr/local/lib/python2.5/cookielib.pyt__init__s.


															cCs
||ijS(N(R(RR((s%/usr/local/lib/python2.5/cookielib.pythas_nonstandard_attrscCs|ii||S(N(Rtget(RRtdefault((s%/usr/local/lib/python2.5/cookielib.pytget_nonstandard_attrscCs||i|<dS(N(R(RRR((s%/usr/local/lib/python2.5/cookielib.pytset_nonstandard_attrscCsI|djoti}n|idj	o|i|jotSntS(N(RR7RRR(Rtnow((s%/usr/local/lib/python2.5/cookielib.pyt
is_expireds

 cCs||idjo
d}nd|i}|i||i}|idj	od|i|if}n
|i}d||fS(NR\Rs%s=%ss<Cookie %s for %s>(RRRRRR(Rtptlimitt	namevalue((s%/usr/local/lib/python2.5/cookielib.pyt__str__
s

	cCsg}x:dD]2}t||}|id|t|fq
W|idt|i|idt|iddi|S(NRRRRRRRRRRRRRRRs%s=%ssrest=%ss
rfc2109=%ss
Cookie(%s)s, (sversionsnamesvaluesportsport_specifiedsdomainsdomain_specifiedsdomain_initial_dotspathspath_specifiedssecuresexpiressdiscardscommentscomment_url(tgetattrRytreprRRR(RRRR((s%/usr/local/lib/python2.5/cookielib.pyt__repr__s!N(t__name__t
__module__t__doc__RRRRRRRRR(((s%/usr/local/lib/python2.5/cookielib.pyRs 			
cBs2eZdZdZdZdZdZRS(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
tdS(sReturn 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(RtcookieR((s%/usr/local/lib/python2.5/cookielib.pytset_ok,scCs
tdS(sAReturn true if (and only if) cookie should be returned to server.N(R(RRR((s%/usr/local/lib/python2.5/cookielib.pyt	return_ok5scCstS(sMReturn false if cookies should not be returned, given cookie domain.
        (R(RRR((s%/usr/local/lib/python2.5/cookielib.pytdomain_return_ok9scCstS(sKReturn false if cookies should not be returned, given cookie path.
        (R(RRR((s%/usr/local/lib/python2.5/cookielib.pytpath_return_ok>s(RRRRRRR(((s%/usr/local/lib/python2.5/cookielib.pyR#s
				c
Bs#eZdZdZdZdZdZeeBZdde	e
de
e
e	e
ee
e
dZdZdZ
dZd	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!RS(sBImplements the standard rules for accepting and returning cookies.iiiic

Cs||_||_||_||_||_||_|	|_|
|_||_||_	|dj	ot||_n
d|_|dj	ot|}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(
Rtblocked_domainstallowed_domainsRRRRRRRRRR((s%/usr/local/lib/python2.5/cookielib.pyRNs 
										
	
cCs|iS(s4Return the sequence of blocked domains (as a tuple).(R(R((s%/usr/local/lib/python2.5/cookielib.pyRoscCst||_dS(s$Set the sequence of blocked domains.N(RR(RR((s%/usr/local/lib/python2.5/cookielib.pytset_blocked_domainsrscCs0x)|iD]}t||otSq
q
WtS(N(RRRR(RRtblocked_domain((s%/usr/local/lib/python2.5/cookielib.pyt
is_blockedvs

cCs|iS(s=Return None, or the sequence of allowed domains (as a tuple).(R(R((s%/usr/local/lib/python2.5/cookielib.pyR|scCs*|dj	ot|}n||_dS(s-Set the sequence of allowed domains, or None.N(RRR(RR((s%/usr/local/lib/python2.5/cookielib.pytset_allowed_domainss
cCsH|idjotSnx)|iD]}t||otSq"q"WtS(N(RRRRR(RRtallowed_domain((s%/usr/local/lib/python2.5/cookielib.pytis_not_alloweds
cCsstd|i|i|id	j	ptx?d
D]7}d|}t||}|||ptSq4q4WtS(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=%sRt
verifiabilityRRRRtset_ok_N(sversionRsnamespathsdomainsport(RRRRRsRRR(RRRtntfn_nametfn((s%/usr/local/lib/python2.5/cookielib.pyRs
cCs|idjotd|i|itSn|idjo|iotdtSn.|idjo|iotdtSntS(Ns0   Set-Cookie2 without version attribute (%s=%s)is$   RFC 2965 cookies are switched offs$   Netscape cookies are switched off(	RRRRRRRRR(RRR((s%/usr/local/lib/python2.5/cookielib.pytset_ok_versions

cCsz|ioit|o\|idjo|iotdtSqv|idjo|iotdtSqvntS(Nis>   third-party RFC 2965 cookie during unverifiable transactions>   third-party Netscape cookie during unverifiable transaction(tis_unverifiableRRRRRRR(RRR((s%/usr/local/lib/python2.5/cookielib.pytset_ok_verifiabilitys

cCsI|idjo5|io+|iidotd|itSntS(Nit$s'   illegal name (starts with '$'): '%s'(RRRRzRRR(RRR((s%/usr/local/lib/python2.5/cookielib.pytset_ok_names
cCsw|ioit|}|idjp|idjo|io/|i|iotd|i|tSqsntS(Nis7   path attribute %s is not a prefix of request path %s(	RRRRRzRRRR(RRRR((s%/usr/local/lib/python2.5/cookielib.pytset_ok_paths

c
Cs|i|iotd|itSn|i|iotd|itSn|ioZt|\}}|i}|io|iddjo|i	d}|i	dd|}|djo^||d}||d|!}	|	i
d"jo(t|djotd|tSq*q.n|ido|d}
n|}
|
i
ddj}|o"|djotd|tSn|idjoS|i|o>|ido-d|i|otd||tSqn|idjp|i|i@o,t||ptd ||tSqAn|idjp|i|i@oT|t| }|i
ddjo)ti|otd!||tSqqntS(#Ns"   domain %s is in user block-lists&   domain %s is not in user allow-listRiiitcotactcomtedutorgtnettgovtmilRHtaerotbiztcattcooptinfotjobstmobitmuseumRtprottravelteus&   country-code second level domain %ss.locals/   non-local domain %s contains no embedded dotsS   effective request-host %s (even with added initial dot) does not end 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
RRRR
RRRtcountRRPtlenRzRRRRtDomainRFC2965MatchRtDomainStrictNoDotsRRGR(
RRRRRRRtjttldtsldtundotted_domaint
embedded_dotsthost_prefix((s%/usr/local/lib/python2.5/cookielib.pyt
set_ok_domainsf
	 
	



cCs|iot|}|djo
d}n
t|}x||iidD]M}yt|Wn$tj
otd|t	SnX||joPqLqLWtd||it	Snt
S(Nt80Rps   bad port %s (not numeric)s$   request port (%s) not found in %s(RRRtstrRRRHRQRRR(RRRtreq_portR((s%/usr/local/lib/python2.5/cookielib.pytset_ok_port
s$



	
	
cCs\td|i|ix?d	D]7}d|}t||}|||ptSqqWtS(
s
        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=%sRRRRRRt
return_ok_(sversions
verifiabilityssecuresexpiressportsdomain(RRRRRR(RRRRRR((s%/usr/local/lib/python2.5/cookielib.pyRs	
cCs^|idjo|iotdtSn.|idjo|iotdtSntS(Nis$   RFC 2965 cookies are switched offs$   Netscape cookies are switched off(RRRRRR(RRR((s%/usr/local/lib/python2.5/cookielib.pytreturn_ok_version1s

cCsz|ioit|o\|idjo|iotdtSqv|idjo|iotdtSqvntS(Nis>   third-party RFC 2965 cookie during unverifiable transactions>   third-party Netscape cookie during unverifiable transaction(RRRRRRRR(RRR((s%/usr/local/lib/python2.5/cookielib.pytreturn_ok_verifiability:s

cCs3|io%|idjotdtSntS(Nthttpss(   secure cookie with non-secure request(Rtget_typeRRR(RRR((s%/usr/local/lib/python2.5/cookielib.pytreturn_ok_secureFs
cCs)|i|iotdtSntS(Ns   cookie expired(Rt_nowRRR(RRR((s%/usr/local/lib/python2.5/cookielib.pytreturn_ok_expiresLs
cCs{|iomt|}|djo
d}nxG|iidD]}||joPq@q@Wtd||itSntS(NR7Rps0   request port %s does not match cookie port %s(RRRRRRR(RRRR9R((s%/usr/local/lib/python2.5/cookielib.pytreturn_ok_portRs



	
cCst|\}}|i}|idjo;|i|i@o*|io||jotdtSn|idjo)t||otd||tSn|idjo-d|i	|otd||tSnt
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 %sRs;   request-host %s does not match Netscape cookie domain %s(RRRRtDomainStrictNonDomainRRRRRR(RRRRRR((s%/usr/local/lib/python2.5/cookielib.pytreturn_ok_domain`s 	
!
%
cCst|\}}|idpd|}n|idpd|}n|i|p
|i|ptSn|i|otd|tSn|i|otd|tSntS(NRs"   domain %s is in user block-lists&   domain %s is not in user allow-list(RRzRRR
RR
R(RRRRR((s%/usr/local/lib/python2.5/cookielib.pyRvs 

cCsEtd|t|}|i|ptd||tSntS(Ns- checking cookie path=%ss  %s does not path-match %s(RRRzRR(RRRR((s%/usr/local/lib/python2.5/cookielib.pyRs
N("RRRR/RDR.t
DomainLiberaltDomainStrictRRRRRRR
RRR
RRRRRR6R:RR<R=R@RBRCRERR(((s%/usr/local/lib/python2.5/cookielib.pyRDsL
													;										cCs&|i}|it|i|S(N(tkeystsorttmapR(tadictRH((s%/usr/local/lib/python2.5/cookielib.pytvals_sorted_by_keys
ccszt|}xg|D]_}t}y|iWntj
on$Xt}xt|D]}|VqSW|p	|VqqWdS(sBIterates over nested mapping, depth-first, in sorted order by key.N(RLRtitemstAttributeErrorRt
deepvalues(tmappingtvaluestobjtsubobj((s%/usr/local/lib/python2.5/cookielib.pyROs
	tAbsentcBseZRS((RR(((s%/usr/local/lib/python2.5/cookielib.pyRTscBs(eZdZeidZeidZeidZeidZeidZ	dZ
ddZdZ
d	Zd
ZdZdZd
ZdZdZdZdZdZdZdZddddZdZdZdZdZdZdZ RS(sCollection 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?|djo
t}n||_ti|_h|_dS(N(RRt_policyt
_threadingtRLockt
_cookies_lockt_cookies(Rtpolicy((s%/usr/local/lib/python2.5/cookielib.pyRs


	cCs
||_dS(N(RU(RRZ((s%/usr/local/lib/python2.5/cookielib.pyt
set_policyscCsg}|ii||pgSntd||i|}x|iD]}|ii||pqKn||}xR|iD]D}|ii||ptdqntd|i|qWqKW|S(Ns!Checking %s for cookies to returns   not returning cookies   it's a match(	RURRRYRHRRQRRy(RRRtcookiestcookies_by_pathRtcookies_by_nameR((s%/usr/local/lib/python2.5/cookielib.pyt_cookies_for_domains$






cCs=g}x0|iiD]}|i|i||qW|S(s2Return a list of cookies to be returned to server.(RYRHtextendR_(RRR\R((s%/usr/local/lib/python2.5/cookielib.pyt_cookies_for_requests
c
Csd}|i|t}g}x|D]}|i}|p,t}|djo|id|qkn|idj	o?|ii|io)|djo|i	i
d|i}n
|i}|idjo|i|in|id|i|f|djo|io|id|i
n|iidoG|i}|io|ido|d}n|id	|n|idj	o6d
}	|io|	d|i}	n|i|	qq)q)W|S(
sReturn 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).

        cSstt|it|iS(N(tcmpR-R(taR((s%/usr/local/lib/python2.5/cookielib.pytdecreasing_sizesis$Version=%ss\\\1s%s=%ss
$Path="%s"Ris$Domain="%s"s$Ports="%s"N(RIRRRRyRRtnon_word_reRGtquote_reRbRRRRRzRRR(
RR\RdRtattrsRRRRR((s%/usr/local/lib/python2.5/cookielib.pyt
_cookie_attrssB
	
	
#	

	
cCs
td|iitti|i_|_|i|}|i|}|o1|i	dp|i
ddi|qn|iioY|ii
oK|i	do:x7|D]+}|idjo|i
ddPqqWn|ii|idS(sAdd 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(RRXtacquireRHR7RURARaRht
has_headertadd_unredirected_headerRRRRtreleasetclear_expired_cookies(RRR\RgR((s%/usr/local/lib/python2.5/cookielib.pyRis$



c
Cs;g}d}d}x"|D]}|d\}}t}t}	h}
h}x|dD]\}}
|i}||jp
||jo
|}n||jo|
djo
t}
n||
joqRn|djo2|
djotd
t}	Pn|
i}
n|djo0|oqRn|
djotdqRqBn|djoTt}yt|
}
Wn$tj
otdt}	PnXd}|i|
}
n||jp
||joA|
djo&|djotd|t}	Pn|
|
|<qR|
||<qRW|	oqn|i|||
|fqW|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.

        RRRRsmax-ageRRRRt
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-agesdomainspathsportscommentRpN(sportscommentRp(	RRPRRRRHRQRARy(Rt	attrs_sett
cookie_tuplest
boolean_attrstvalue_attrstcookie_attrsRRtmax_age_sett
bad_cookietstandardRRRR((s%/usr/local/lib/python2.5/cookielib.pyt_normalized_cookie_tuples>sp














cCs|\}}}}|idt}|idt}|idt}	|idt}
|idd}|dj	ot|}n|idt}|idt}
|idd}|id	d}|tj	o#|d
jot}t|}nyt}t|}|id}|djo-|d
jo|| }q\||d }nt	|d
jo
d}n|tj	}t}|ot
|id}n|tjot|\}}|}n|idpd|}nt}|	tj	o<|	djot
|}	qGt}tidd
|	}	nd}	|
tjod}
t}
nY|
|ijoHy|i|||Wntj
onXtd|||dSnt||||	||||||||
|
|||S(NRRRRRRRRRpR\RiiiRs\s+s2Expiring cookie, domain='%s', path='%s', name='%s'(RRTRRHRRRRRR-tboolRzRRR{RbRAtcleartKeyErrorRR(RttupRRRRxRRRRRRRRRRRRRRRRR((s%/usr/local/lib/python2.5/cookielib.pyt_cookie_from_cookie_tuples|










	cCsT|i|}g}x8|D]0}|i||}|o|i|qqW|S(N(RyR~Ry(RRqRRrR\R}R((s%/usr/local/lib/python2.5/cookielib.pyt_cookies_from_attrs_setscCsyt|idd}|djo|ii}nx?|D]7}|idjo!t|_|o
d|_qqq:q:WdS(NRii(RRURRRRR(RR\t
rfc2109_as_nsR((s%/usr/local/lib/python2.5/cookielib.pyt_process_rfc2109_cookiess
	c
Cs|i}|id}|id}|ii}|ii}|o|p0|o|p |o|p|o|ogSny|it||}Wn tj
otg}nX|o|oy|it	||}	Wn tj
otg}	nX|i
|	|oRh}
x*|D]"}d|
|i|i
|if<q7W|
d}t||	}	n|	o|i|	qn|S(sAReturn sequence of Cookie objects extracted from response object.sSet-Cookie2s
Set-CookiecSs"|i|i|if}||jS(N(RRR(t	ns_cookietlookuptkey((s%/usr/local/lib/python2.5/cookielib.pytno_matching_rfc29658sN(R%t
getheadersRURRRRt	ExceptionRRRRRRRtfilterR`(
RtresponseRRtrfc2965_hdrstns_hdrsRRR\t
ns_cookiesRRR((s%/usr/local/lib/python2.5/cookielib.pytmake_cookiessD
 cCsd|iitti|i_|_|ii||o|i|n|iidS(s-Set a cookie if policy says it's OK to do so.N(	RXRkRHR7RURARt
set_cookieRn(RRR((s%/usr/local/lib/python2.5/cookielib.pytset_cookie_if_okBs

cCs|i}|iizm|i|joh||i<n||i}|i|joh||i<n||i}|||i<Wd|iiXdS(s?Set a cookie, without checking whether or not it should be set.N(RYRXRkRRRRn(RRtctc2tc3((s%/usr/local/lib/python2.5/cookielib.pyRLs	


cCstd|i|iitti|i_|_xN|i||D]:}|ii	||otd||i
|qRqRW|iidS(sAExtract cookies from response, where allowable given the request.sextract_cookies: %ss setting cookie: %sN(RR%RXRkRHR7RURARRRRn(RRRR((s%/usr/local/lib/python2.5/cookielib.pytextract_cookiesYs

cCs|dj	o@|djp
|djotdn|i|||=na|dj	o/|djotdn|i||=n%|dj	o|i|=n
h|_dS(sClear 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(RRQRY(RRRR((s%/usr/local/lib/python2.5/cookielib.pyR{es





cCsY|iix8|D]0}|io |i|i|i|iqqW|iidS(sDiscard 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(RXRkRR{RRRRn(RR((s%/usr/local/lib/python2.5/cookielib.pytclear_session_cookiess

$cCsk|iiti}x>|D]6}|i|o |i|i|i|iq q W|iidS(sDiscard 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(	RXRkR7RR{RRRRn(RRR((s%/usr/local/lib/python2.5/cookielib.pyRos

$cCs
t|iS(N(RORY(R((s%/usr/local/lib/python2.5/cookielib.pyt__iter__scCs%d}x|D]}|d}q
W|S(s#Return number of contained cookies.ii((RRR((s%/usr/local/lib/python2.5/cookielib.pyt__len__s
cCsDg}x!|D]}|it|q
Wd|idi|fS(Ns<%s[%s]>s, (RyRt	__class__R(RtrR((s%/usr/local/lib/python2.5/cookielib.pyRs
cCsDg}x!|D]}|it|q
Wd|idi|fS(Ns<%s[%s]>s, (RyR8RR(RRR((s%/usr/local/lib/python2.5/cookielib.pyRs
N(!RRRR{tcompileReRftstrict_domain_ret	domain_retdots_retmagic_reRRR[R_RaRhRiRyR~RRRRRRR{RRoRRRR(((s%/usr/local/lib/python2.5/cookielib.pyRs8				<		a	X				6	
	
		
				cBseZRS((RR(((s%/usr/local/lib/python2.5/cookielib.pyRscBsVeZdZdeddZdeedZdeedZdeedZRS(s6CookieJar that can be loaded from and saved to a file.cCs_ti|||dj	o&y|dWqCtdqCXn||_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(RRRRQtfilenameRzt	delayload(RRRRZ((s%/usr/local/lib/python2.5/cookielib.pyRs
	cCs
tdS(sSave cookies to a file.N(R(RRtignore_discardtignore_expires((s%/usr/local/lib/python2.5/cookielib.pytsavescCsr|djo-|idj	o
|i}q:ttnt|}z|i||||Wd|iXdS(sLoad cookies from a file.N(RRRQtMISSING_FILENAME_TEXTtopent_really_loadtclose(RRRRR((s%/usr/local/lib/python2.5/cookielib.pytloads

cCs|djo-|idj	o
|i}q:ttn|iiti|i}h|_y|i	|||Wn%t
tfj
o||_nX|iidS(sClear 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(
RRRQRRXRkRtdeepcopyRYRRtIOErrorRn(RRRRt	old_state((s%/usr/local/lib/python2.5/cookielib.pytreverts


		N(	RRRRRRRRR(((s%/usr/local/lib/python2.5/cookielib.pyRs(Rtlwp_cookie_str(R(WRt__all__R{RRR7Rt	threadingRVtImportErrortdummy_threadingthttplibtcalendarRRR
RRRR8t	HTTP_PORTRRRRR#R<R=RNRRyRPR;R?RERRFRMR[R]tIRatXRcRfRgRiRoRtRuRwRvRRRRRRRRRRRRRRRRRRRRRRRRLRORTRRRRt
_LWPCookieJarRRt_MozillaCookieJarR(((s%/usr/local/lib/python2.5/cookielib.pys<module>s<	
		*		5		8	!		U		5		'	
								#	b!R		:

Man Man