Hacked By AnonymousFox

Current Path : /opt/alt/python33/lib64/python3.3/http/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/http/__pycache__/cookiejar.cpython-33.pyo

�
��f�(c@s�dZddddddddgZd	d
lZd	d
lZd	d
lZd	d
lZd	d
lZd	d
lZyd	d
l	Z
Wnek
r�d	d
lZ
YnXd	d
l
Zd	dlmZeZeadd
�Zeejj�ZdZdd�ZdZdd�ZdddddddgZdddddd d!d"d#d$d%d&gZgZ x!eD]Z!e j"e!j#��qYWed'd(�Z$ed)d*�Z%ied+6ed,6ed-6ed.6Z&ej'd/ej(�Z)d0d1�Z*d2d3�Z+ej'd4ej(�Z,ej'd5ej-ej(B�Z.ej'd6ej/ej(B�Z0d7d8�Z1ej'd9ej/ej(B�Z2d:d;�Z3d<d=�Z4ej'd>�Z5ej'd?�Z6ej'd@�Z7ej'dA�Z8dBdC�Z9ej'dD�Z:dEdF�Z;dGdH�Z<dIdJ�Z=ej'dKej(�Z>dLdM�Z?dNdO�Z@dPdQ�ZAdRdS�ZBej'dTej(�ZCdUdV�ZDdWdX�ZEdYdZ�ZFd[d\�ZGd]ZHej'd^�ZId_d`�ZJdadb�ZKdcdd�ZLdedf�ZMGdgd�d�ZNGdhd�d�ZOGdid�deO�ZPdjdk�ZQdldm�ZRGdndo�do�ZSGdpd�d�ZTGdqd�deU�ZVGdrd�deT�ZWdsdt�ZXGdud�deW�ZYGdvd�deW�ZZd
S(wu�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

uCookieu	CookieJaruCookiePolicyuDefaultCookiePolicyu
FileCookieJaruLWPCookieJaru	LoadErroruMozillaCookieJariN(utimegmcGs;ts
dSts.ddl}|jd�antj|�S(Niuhttp.cookiejar(udebuguloggeruloggingu	getLogger(uargsulogging((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_debug.su_debuguQa filename was not supplied (nor was the CookieJar instance initialised with one)cCsgddl}ddl}ddl}|j�}|jd|�|j�}|jd|dd�dS(Niuhttp.cookiejar bug!
%su
stackleveli(uiouwarningsu	tracebackuStringIOu	print_excuNoneugetvalueuwarn(uiouwarningsu	tracebackufumsg((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_warn_unhandled_exception<s
$u_warn_unhandled_exceptioni�cCs�|dd�\}}}}}}|tkr�d|koEdknr�d|koadknr�d|ko}dknr�d|ko�dknr�d|ko�dknr�t|�SdSdS(	Niiiiiii;i=(u
EPOCH_YEARutimegmuNone(uttuyearumonthumdayuhouruminusec((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_timegmKs
"DT
u_timegmuMonuTueuWeduThuuFriuSatuSunuJanuFebuMaruApruMayuJunuJuluAuguSepuOctuNovuDeccCs\|dkrtjj�}ntjj|�}d|j|j|j|j|j|j	fS(uHReturn 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

    u%04d-%02d-%02d %02d:%02d:%02dZN(
uNoneudatetimeuutcnowuutcfromtimestampuyearumonthudayuhouruminuteusecond(utudt((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu	time2isozYs
u	time2isozcCsq|dkrtjj�}ntjj|�}dt|j�|jt|jd|j	|j
|j|jfS(u�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

    u"%s %02d-%s-%04d %02d:%02d:%02d GMTiN(
uNoneudatetimeuutcnowuutcfromtimestampuDAYSuweekdayudayuMONTHSumonthuyearuhouruminuteusecond(utudt((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
time2netscapels!u
time2netscapeuGMTuUTCuUTuZu^([-+])?(\d\d?):?(\d\d)?$cCs�d}|tkrd}ntj|�}|r�dt|jd��}|jd�rx|dt|jd��}n|jd�dkr�|}q�n|S(Niiiii<iu-(uNoneu	UTC_ZONESuTIMEZONE_REusearchuintugroup(utzuoffsetum((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuoffset_from_tz_string�s	 
uoffset_from_tz_stringc
Csytj|j��d}Wndtk
r�yt|�}Wntk
rUdSYnXd|komdknr{|}ndSYnX|dkr�d}n|dkr�d}n|dkr�d}nt|�}t|�}t|�}t|�}t|�}|dkr�tjtj��d}|d}	|}
|||	}|	|
}	t|	�dkr�|	dkrw|d}q�|d}q�nt	|||||||f�}|dk	r�|dkr�d}n|j
�}t|�}|dkr�dS||}n|S(Niiii�idi2uUTC(uMONTHS_LOWERuindexuloweru
ValueErroruintuNoneutimeu	localtimeuabsu_timegmuupperuoffset_from_tz_string(
udayumonuyruhruminusecutzuimonucur_yrumutmputuoffset((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu	_str2time�sR

						


!	
u	_str2timeuV^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$u+^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)[a-z]*,?\s*u�^
    (\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*$cCs4tj|�}|r�|j�}tj|dj��d}t|d�|t|d�t|d�t|d�t|d�f}t|�S|j	�}t
jd|d�}d	gd\}}}}}}	}
t
j|�}|d	k	r|j�\}}}}}}	}
nd	St||||||	|
�S(
u�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.

    iiiiiiuiN(uSTRICT_DATE_REusearchugroupsuMONTHS_LOWERuindexuloweruintufloatu_timegmulstripu
WEEKDAY_REusubuNoneuLOOSE_HTTP_DATE_REu	_str2time(utextumugumonuttudayuyruhruminusecutz((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu	http2time�s-
"$u	http2timeu�^
    (\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(uv
    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(ulstripuNoneuISO_DATE_REusearchugroupsu	_str2time(
utextudayumonuyruhruminusecutzumu_((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuiso2time$s
"'uiso2timecCs7|jd�\}}|jd|�|j|d�S(u)Return unmatched part of re.Match object.iN(uspanustring(umatchustartuend((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu	unmatchedEsu	unmatchedu^\s*([^=\s;,]+)u&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"u^\s*=\s*([^\s;,]*)u\\(.)c
Cs�g}xx|D]p}|}g}xE|rftj|�}|r�t|�}|jd�}tj|�}|r�t|�}|jd�}tjd|�}nEtj|�}|r�t|�}|jd�}|j�}nd}|j
||f�q"|j�jd�rB|j�dd�}|r9|j
|�ng}q"t
jdd|�\}}	|}q"W|r
|j
|�q
q
W|S(umParse 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"')]]

    iu\1u,Nu^[=\s;]*u(uHEADER_TOKEN_REusearchu	unmatchedugroupuHEADER_QUOTED_VALUE_REuHEADER_ESCAPE_REusubuHEADER_VALUE_REurstripuNoneuappendulstripu
startswithureusubn(
u
header_valuesuresultutextu	orig_textupairsumunameuvalueunon_junku
nr_junk_chars((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyusplit_header_wordsNs>.
		
usplit_header_wordsu([\"\\])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(u�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"'

    u^\w+$u\\\1u"%s"u%s=%su; u, N(uNoneureusearchuHEADER_JOIN_ESCAPE_REusubuappendujoin(ulistsuheadersupairsuattrukuv((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyujoin_header_words�s

ujoin_header_wordscCsH|jd�r"|dd�}n|jd�rD|dd�}n|S(Nu"ii����(u
startswithuendswith(utext((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyustrip_quotes�s
ustrip_quotescCshd}g}xU|D]M}g}d}xttjd|��D]�\}}|j�}|d	krhq>nd
|kr�|d}}	n'tjd|d�\}}	|j�}|d
kr|j�}
|
|kr�|
}n|dkr�t|	�}	d}n|dkrt
t|	��}	qn|j||	f�q>W|r|sP|jd�n|j|�qqW|S(u5Ad-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.

    uexpiresudomainupathusecureuversionuportumax-ageu;\s*uu=u\s*=\s*iiu0(uexpiresudomainupathusecureuversionuportumax-ageFNT(uversionu0(uFalseu	enumerateureuspliturstripuNoneulstripulowerustrip_quotesuTrueu	http2timeuappend(u
ns_headersuknown_attrsuresultu	ns_headerupairsuversion_setuiiuparamukuvulc((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuparse_ns_headers�s:
%		uparse_ns_headersu\.\d+$cCsKtj|�rdS|dkr#dS|ddksC|ddkrGdSdS(u*Return True if text is a host domain name.uiu.iFi����T(uIPV4_REusearchuFalseuTrue(utext((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuis_HDN�s uis_HDNcCs�|j�}|j�}||kr(dSt|�s8dS|j|�}|dks_|dkrcdS|jd�svdSt|dd��s�dSdS(u�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.

    iiu.NTFi����(uloweruTrueuis_HDNuFalseurfindu
startswith(uAuBui((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyudomain_matchsudomain_matchcCstj|�rdSdS(udReturn True if text is a sort-of-like a host domain name.

    For accepting/blocking domains.

    FT(uIPV4_REusearchuFalseuTrue(utext((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuliberal_is_HDN/suliberal_is_HDNcCs�|j�}|j�}t|�o-t|�sD||kr@dSdS|jd�}|rl|j|�rldS|r�||kr�dSdS(u\For blocking/accepting domains.

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

    u.TF(uloweruliberal_is_HDNuTrueuFalseu
startswithuendswith(uAuBuinitial_dot((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuuser_domain_match9suuser_domain_matchu:\d+$cCsb|j�}tjj|�d}|dkrC|jdd�}ntjd|d�}|j�S(u�Return request-host, as defined by RFC 2965.

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

    iuuHost(uget_full_urluurllibuparseuurlparseu
get_headerucut_port_reusubulower(urequestuurluhost((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyurequest_hostNsurequest_hostcCsLt|�}}|jd�dkrBtj|�rB|d}n||fS(uzReturn a tuple (request-host, effective request-host name).

    As defined by RFC 2965, except both are lowercased.

    u.iu.locali����(urequest_hostufinduIPV4_REusearch(urequestuerhnureq_host((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyueff_request_host^s%
ueff_request_hostcCsM|j�}tjj|�}t|j�}|jd�sId|}n|S(u6Path component of request-URI, as defined by RFC 2965.u/(uget_full_urluurllibuparseuurlsplituescape_pathupathu
startswith(urequestuurlupartsupath((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyurequest_pathis
urequest_pathcCsy|j}|jd�}|dkro||dd�}yt|�Wqutk
rktd|�dSYquXnt}|S(Nu:iiunonnumeric port: '%s'(uhostufinduintu
ValueErroru_debuguNoneuDEFAULT_HTTP_PORT(urequestuhostuiuport((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyurequest_portss	

urequest_portu%/;:@&=+$,!~*'()u%([0-9a-fA-F][0-9a-fA-F])cCsd|jd�j�S(Nu%%%si(ugroupuupper(umatch((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuuppercase_escaped_char�suuppercase_escaped_charcCs+tjj|t�}tjt|�}|S(uEEscape any invalid characters in HTTP URL, and uppercase all escapes.(uurllibuparseuquoteuHTTP_PATH_SAFEuESCAPED_CHAR_REusubuuppercase_escaped_char(upath((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuescape_path�s
uescape_pathcCsq|jd�}|dkrm||dd�}|jd�}t|�rm|dksb|dkrmd|Sn|S(uBReturn 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'

    u.iiNulocal(ufinduis_HDN(uhuiub((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyureach�s$ureachcCs0t|�}t|t|j��s(dSdSdS(u�

    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.

    NTF(urequest_hostudomain_matchureachuorigin_req_hostuTrueuFalse(urequestureq_host((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuis_third_party�s
uis_third_partycBsw|EeZdZdZddd�Zdd�Zddd�Zdd	�Z	dd
d�Z
dd
�Zdd�ZdS(uCookieu�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]|dkr]td��n||_||_||_||_||_|j	�|_
||_||_|	|_
|
|_||_||_|
|_||_||_||_tj|�|_dS(Nu-if port is None, port_specified must be falseT(uNoneuintuTrueu
ValueErroruversionunameuvalueuportuport_specifiedulowerudomainudomain_specifiedudomain_initial_dotupathupath_specifiedusecureuexpiresudiscarducommentucomment_urlurfc2109ucopyu_rest(uselfuversionunameuvalueuportuport_specifiedudomainudomain_specifiedudomain_initial_dotupathupath_specifiedusecureuexpiresudiscarducommentucomment_urluresturfc2109((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__init__�s.
															uCookie.__init__cCs
||jkS(N(u_rest(uselfuname((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuhas_nonstandard_attrsuCookie.has_nonstandard_attrcCs|jj||�S(N(u_restuget(uselfunameudefault((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuget_nonstandard_attrsuCookie.get_nonstandard_attrcCs||j|<dS(N(u_rest(uselfunameuvalue((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_nonstandard_attr	suCookie.set_nonstandard_attrcCsA|dkrtj�}n|jdk	r=|j|kr=dSdS(NTF(uNoneutimeuexpiresuTrueuFalse(uselfunow((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
is_expireds
uCookie.is_expiredcCsx|jdkrd}n
d|j}|j||j}|jdk	rad|j|jf}n	|j}d||fS(Nuu:u%s=%su<Cookie %s for %s>(uportuNoneudomainupathuvalueuname(uselfupulimitu	namevalue((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__str__s	
	uCookie.__str__cCs�g}x:dD]2}t||�}|jd|t|�f�q
W|jdt|j��|jdt|j��ddj|�S(Nuversionunameuvalueuportuport_specifiedudomainudomain_specifiedudomain_initial_dotupathupath_specifiedusecureuexpiresudiscarducommentucomment_urlu%s=%surest=%su
rfc2109=%su
Cookie(%s)u, (uversionunameuvalueuportuport_specifiedudomainudomain_specifiedudomain_initial_dotupathupath_specifiedusecureuexpiresudiscarducommentucomment_url(ugetattruappendurepru_resturfc2109ujoin(uselfuargsunameuattr((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__repr__s
!uCookie.__repr__NF(
u__name__u
__module__u__qualname__u__doc__uFalseu__init__uhas_nonstandard_attruNoneuget_nonstandard_attruset_nonstandard_attru
is_expiredu__str__u__repr__(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuCookie�s 
cBsJ|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
S(uCookiePolicyu 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(u�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(uNotImplementedError(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_ok4suCookiePolicy.set_okcCs
t��dS(uAReturn true if (and only if) cookie should be returned to server.N(uNotImplementedError(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu	return_ok=suCookiePolicy.return_okcCsdS(uMReturn false if cookies should not be returned, given cookie domain.
        T(uTrue(uselfudomainurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyudomain_return_okAsuCookiePolicy.domain_return_okcCsdS(uKReturn false if cookies should not be returned, given cookie path.
        T(uTrue(uselfupathurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyupath_return_okFsuCookiePolicy.path_return_okN(u__name__u
__module__u__qualname__u__doc__uset_oku	return_okudomain_return_okupath_return_ok(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuCookiePolicy+s
	cBst|EeZdZdZdZdZdZdZeeBZd4d4d5d6d4d6d6d5d6ed6d6dd�Zdd	�Z
d
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Z d0d1�Z!d2d3�Z"d4S(7uDefaultCookiePolicyuBImplements the standard rules for accepting and returning cookies.iiiic

Cs�||_||_||_||_||_||_|	|_|
|_||_||_	|dk	rxt|�|_n	f|_|dk	r�t|�}n||_
dS(uAConstructor arguments should be passed as keyword arguments only.N(unetscapeurfc2965urfc2109_as_netscapeuhide_cookie2u
strict_domainustrict_rfc2965_unverifiableustrict_ns_unverifiableustrict_ns_domainustrict_ns_set_initial_dollarustrict_ns_set_pathuNoneutupleu_blocked_domainsu_allowed_domains(
uselfublocked_domainsuallowed_domainsunetscapeurfc2965urfc2109_as_netscapeuhide_cookie2u
strict_domainustrict_rfc2965_unverifiableustrict_ns_unverifiableustrict_ns_domainustrict_ns_set_initial_dollarustrict_ns_set_path((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__init__Vs 
											uDefaultCookiePolicy.__init__cCs|jS(u4Return the sequence of blocked domains (as a tuple).(u_blocked_domains(uself((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyublocked_domainswsu#DefaultCookiePolicy.blocked_domainscCst|�|_dS(u$Set the sequence of blocked domains.N(utupleu_blocked_domains(uselfublocked_domains((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_blocked_domainszsu'DefaultCookiePolicy.set_blocked_domainscCs+x$|jD]}t||�r
dSq
WdS(NTF(u_blocked_domainsuuser_domain_matchuTrueuFalse(uselfudomainublocked_domain((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
is_blocked~suDefaultCookiePolicy.is_blockedcCs|jS(u=Return None, or the sequence of allowed domains (as a tuple).(u_allowed_domains(uself((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuallowed_domains�su#DefaultCookiePolicy.allowed_domainscCs(|dk	rt|�}n||_dS(u-Set the sequence of allowed domains, or None.N(uNoneutupleu_allowed_domains(uselfuallowed_domains((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_allowed_domains�su'DefaultCookiePolicy.set_allowed_domainscCs>|jdkrdSx$|jD]}t||�rdSqWdS(NFT(u_allowed_domainsuNoneuFalseuuser_domain_matchuTrue(uselfudomainuallowed_domain((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuis_not_allowed�su"DefaultCookiePolicy.is_not_allowedcCsWtd|j|j�x:d	D]2}d|}t||�}|||�sd
SqWdS(u�
        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).

        u - checking cookie %s=%suversionu
verifiabilityunameupathudomainuportuset_ok_(uversionu
verifiabilityunameupathudomainuportFT(u_debugunameuvalueugetattruFalseuTrue(uselfucookieurequestunufn_nameufn((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_ok�s

uDefaultCookiePolicy.set_okcCs{|jdkr)td|j|j�dS|jdkrP|jrPtd�dS|jdkrw|jrwtd�dSdS(Nu0   Set-Cookie2 without version attribute (%s=%s)iu$   RFC 2965 cookies are switched offu$   Netscape cookies are switched offFT(	uversionuNoneu_debugunameuvalueuFalseurfc2965unetscapeuTrue(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_ok_version�s

u"DefaultCookiePolicy.set_ok_versioncCsh|jrdt|�rd|jdkr;|jr;td�dS|jdkrd|jrdtd�dSndS(Niu>   third-party RFC 2965 cookie during unverifiable transactionu>   third-party Netscape cookie during unverifiable transactionFT(uunverifiableuis_third_partyuversionustrict_rfc2965_unverifiableu_debuguFalseustrict_ns_unverifiableuTrue(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_ok_verifiability�s

u(DefaultCookiePolicy.set_ok_verifiabilitycCsB|jdkr>|jr>|jjd�r>td|j�dSdS(Niu$u'   illegal name (starts with '$'): '%s'FT(uversionustrict_ns_set_initial_dollarunameu
startswithu_debuguFalseuTrue(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_ok_name�s
uDefaultCookiePolicy.set_ok_namecCsm|jrit|�}|jdks<|jdkri|jri|j|j�ritd|j|�dSndS(Niu7   path attribute %s is not a prefix of request path %sFT(	upath_specifiedurequest_pathuversionustrict_ns_set_pathu
startswithupathu_debuguFalseuTrue(uselfucookieurequestureq_path((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_ok_path�s	
uDefaultCookiePolicy.set_ok_pathc
Cs�|j|j�r&td|j�d"S|j|j�rLtd|j�d"S|jr�t|�\}}|j}|jr!|jd�dkr!|j	d�}|j	dd|�}|dkr!||dd�}||d|�}	|	j
�d#krt|�dkrtd|�d"Sq!n|jd�rC|dd�}
n|}
|
j
d�dk}|r�|dkr�td|�d"S|jdkr�|j|�r�|jd�r�d|j|�r�td||�d"Sn|jdks�|j|j@r!t||�s!td ||�d"Sn|jdks@|j|j@r�|dt|��}|j
d�dkr�tj|�r�td!||�d"Sq�nd$S(%Nu"   domain %s is in user block-listu&   domain %s is not in user allow-listu.iiiucouacucomueduuorgunetugovumiluintuaeroubizucatucoopuinfoujobsumobiumuseumunameuproutravelueuu&   country-code second level domain %su.localu/   non-local domain %s contains no embedded dotuO   effective request-host %s (even with added initial dot) does not end with %su5   effective request-host %s does not domain-match %su.   host prefix %s for domain %s contains a dotF(ucouacucomueduuorgunetugovumiluintuaeroubizucatucoopuinfoujobsumobiumuseumunameuproutravelueuT(u
is_blockedudomainu_debuguFalseuis_not_allowedudomain_specifiedueff_request_hostu
strict_domainucounturfindulowerulenu
startswithufinduversionuendswithustrict_ns_domainuDomainRFC2965Matchudomain_matchuDomainStrictNoDotsuIPV4_REusearchuTrue(
uselfucookieurequestureq_hostuerhnudomainuiujutlduslduundotted_domainu
embedded_dotsuhost_prefix((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
set_ok_domain�sf			





u!DefaultCookiePolicy.set_ok_domaincCs�|jr�t|�}|dkr*d}nt|�}xx|jjd�D]J}yt|�Wn#tk
r�td|�dSYnX||krIPqIqIWtd||j�dSndS(Nu80u,u   bad port %s (not numeric)u$   request port (%s) not found in %sFT(uport_specifiedurequest_portuNoneustruportusplituintu
ValueErroru_debuguFalseuTrue(uselfucookieurequestureq_portup((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_ok_ports"		

	
uDefaultCookiePolicy.set_ok_portcCsWtd|j|j�x:d	D]2}d|}t||�}|||�sd
SqWdS(u�
        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).

        u - checking cookie %s=%suversionu
verifiabilityusecureuexpiresuportudomainu
return_ok_(uversionu
verifiabilityusecureuexpiresuportudomainFT(u_debugunameuvalueugetattruFalseuTrue(uselfucookieurequestunufn_nameufn((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu	return_ok's	

uDefaultCookiePolicy.return_okcCsR|jdkr'|jr'td�dS|jdkrN|jrNtd�dSdS(Niu$   RFC 2965 cookies are switched offu$   Netscape cookies are switched offFT(uversionurfc2965u_debuguFalseunetscapeuTrue(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyureturn_ok_version9s

u%DefaultCookiePolicy.return_ok_versioncCsh|jrdt|�rd|jdkr;|jr;td�dS|jdkrd|jrdtd�dSndS(Niu>   third-party RFC 2965 cookie during unverifiable transactionu>   third-party Netscape cookie during unverifiable transactionFT(uunverifiableuis_third_partyuversionustrict_rfc2965_unverifiableu_debuguFalseustrict_ns_unverifiableuTrue(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyureturn_ok_verifiabilityBs

u+DefaultCookiePolicy.return_ok_verifiabilitycCs*|jr&|jdkr&td�dSdS(Nuhttpsu(   secure cookie with non-secure requestFT(usecureutypeu_debuguFalseuTrue(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyureturn_ok_secureNs
u$DefaultCookiePolicy.return_ok_securecCs$|j|j�r td�dSdS(Nu   cookie expiredFT(u
is_expiredu_nowu_debuguFalseuTrue(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyureturn_ok_expiresTs
u%DefaultCookiePolicy.return_ok_expirescCsu|jrqt|�}|dkr*d}nxD|jjd�D]}||kr=Pq=q=Wtd||j�dSndS(Nu80u,u0   request port %s does not match cookie port %sFT(uporturequest_portuNoneusplitu_debuguFalseuTrue(uselfucookieurequestureq_portup((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyureturn_ok_portZs		
u"DefaultCookiePolicy.return_ok_portc	Cs�t|�\}}|j}|jdkr^|j|j@r^|jr^||kr^td�dS|jdkr�t||�r�td||�dS|jdkr�d|j	|�r�td||�dSdS(NiuQ   cookie with unspecified domain does not string-compare equal to request domainuQ   effective request-host name %s does not domain-match RFC 2965 cookie domain %su.u;   request-host %s does not match Netscape cookie domain %sFT(ueff_request_hostudomainuversionustrict_ns_domainuDomainStrictNonDomainudomain_specifiedu_debuguFalseudomain_matchuendswithuTrue(uselfucookieurequestureq_hostuerhnudomain((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyureturn_ok_domainhs 	

#
u$DefaultCookiePolicy.return_ok_domaincCs�t|�\}}|jd�s.d|}n|jd�sJd|}n|j|�pe|j|�sldS|j|�r�td|�dS|j|�r�td|�dSdS(Nu.u"   domain %s is in user block-listu&   domain %s is not in user allow-listFT(ueff_request_hostu
startswithuendswithuFalseu
is_blockedu_debuguis_not_alloweduTrue(uselfudomainurequestureq_hostuerhn((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyudomain_return_ok~s



u$DefaultCookiePolicy.domain_return_okcCs@td|�t|�}|j|�s<td||�dSdS(Nu- checking cookie path=%su  %s does not path-match %sFT(u_debugurequest_pathu
startswithuFalseuTrue(uselfupathurequestureq_path((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyupath_return_ok�s
u"DefaultCookiePolicy.path_return_okNTF(#u__name__u
__module__u__qualname__u__doc__uDomainStrictNoDotsuDomainStrictNonDomainuDomainRFC2965Matchu
DomainLiberaluDomainStrictuNoneuTrueuFalseu__init__ublocked_domainsuset_blocked_domainsu
is_blockeduallowed_domainsuset_allowed_domainsuis_not_alloweduset_okuset_ok_versionuset_ok_verifiabilityuset_ok_nameuset_ok_pathu
set_ok_domainuset_ok_portu	return_okureturn_ok_versionureturn_ok_verifiabilityureturn_ok_secureureturn_ok_expiresureturn_ok_portureturn_ok_domainudomain_return_okupath_return_ok(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuDefaultCookiePolicyLsL
	;	cCs"t|j��}t|j|�S(N(usortedukeysumapuget(uadictukeys((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuvals_sorted_by_key�suvals_sorted_by_keyccswt|�}xd|D]\}d}y|jWntk
r>Yn#Xd}xt|�D]}|VqRW|s|VqqWdS(uBIterates over nested mapping, depth-first, in sorted order by key.NFT(uvals_sorted_by_keyuFalseuitemsuAttributeErroruTrueu
deepvalues(umappinguvaluesuobjusubobj((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
deepvalues�s

	u
deepvaluescBs|EeZdZdS(uAbsentN(u__name__u
__module__u__qualname__(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuAbsent�suAbsentcBs�|EeZdZdZejd�Zejd�Zejd�Zejd�Z	ejd�Z
ejdej�Zd2dd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd2d2d2d$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z d.d/�Z!d0d1�Z"d2S(3u	CookieJaru�Collection of HTTP cookies.

    You may not need to know about this class: try
    urllib.request.build_opener(HTTPCookieProcessor).open(url).
    u\Wu([\"\\])u\.?[^.]*u[^.]*u^\.+u^\#LWP-Cookies-(\d+\.\d+)cCs=|dkrt�}n||_tj�|_i|_dS(N(uNoneuDefaultCookiePolicyu_policyu
_threadinguRLocku
_cookies_locku_cookies(uselfupolicy((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__init__�s
	uCookieJar.__init__cCs
||_dS(N(u_policy(uselfupolicy((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
set_policy�suCookieJar.set_policycCs�g}|jj||�sgStd|�|j|}x�|j�D]~}|jj||�sgqFn||}xP|j�D]B}|jj||�s�td�q~ntd�|j|�q~WqFW|S(Nu!Checking %s for cookies to returnu   not returning cookieu   it's a match(	u_policyudomain_return_oku_debugu_cookiesukeysupath_return_okuvaluesu	return_okuappend(uselfudomainurequestucookiesucookies_by_pathupathucookies_by_nameucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_cookies_for_domain�s 




uCookieJar._cookies_for_domaincCs=g}x0|jj�D]}|j|j||��qW|S(u2Return a list of cookies to be returned to server.(u_cookiesukeysuextendu_cookies_for_domain(uselfurequestucookiesudomain((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_cookies_for_request�suCookieJar._cookies_for_requestc	Cs�|jddd�dd�d}g}x�|D]�}|j}|smd}|dkrm|jd|�qmn|jdk	r�|jj|j�r�|dkr�|j	j
d|j�}n	|j}|jdkr�|j|j�n|jd|j|f�|dkr/|jr)|jd	|j
�n|jjd
�r�|j}|jrp|jd
�rp|dd�}n|jd
|�n|jdk	r�d}|jr�|d|j}n|j|�q�q/q/W|S(u�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).

        ukeycSs
t|j�S(N(ulenupath(ua((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu<lambda>�su)CookieJar._cookie_attrs.<locals>.<lambda>ureverseiu$Version=%su\\\1u%s=%su
$Path="%s"u.iNu$Domain="%s"u$Portu="%s"TF(usortuTrueuFalseuversionuappenduvalueuNoneunon_word_reusearchuquote_reusubunameupath_specifiedupathudomainu
startswithudomain_initial_dotuportuport_specified(	uselfucookiesuversion_setuattrsucookieuversionuvalueudomainup((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
_cookie_attrs�s>

	!			
	uCookieJar._cookie_attrscCstd�|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(u�Add correct Cookie: header to request (urllib.request.Request object).

        The Cookie2 header is also added unless policy.hide_cookie2 is true.

        uadd_cookie_headeruCookieu; uCookie2iu$Version="1"N(u_debugu
_cookies_lockuacquireuintutimeu_policyu_nowu_cookies_for_requestu
_cookie_attrsu
has_headeruadd_unredirected_headerujoinurfc2965uhide_cookie2uversionureleaseuclear_expired_cookies(uselfurequestucookiesuattrsucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuadd_cookie_header$s$


uCookieJar.add_cookie_headercCs$g}d}d}x|D]}|d\}}d}d}	i}
i}x�|dd
�D]�\}}
|j�}||ks�||kr�|}n||kr�|
d
kr�d}
n||
kr�qXn|dkr�|
d
kr�td�d}	Pn|
j�}
n|dkr6|rqXn|
d
kr6td�qXq6n|dkr�d}yt|
�}
Wn#tk
r}td�d}	PYnXd}|j|
}
n||ks�||kr�|
d
kr�|dkr�td|�d}	Pn|
|
|<qX|
||<qXW|	rqn|j|||
|f�qW|S(uReturn 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.

        udiscardusecureuversionuexpiresumax-ageudomainupathuportucommentu
commenturliiNu%   missing value for domain attributeuM   missing or invalid value for expires attribute: treating as session cookieu?   missing or invalid (non-numeric) value for max-age attributeu!   missing value for %s attribute(udiscardusecure(uversionuexpiresumax-ageudomainupathuportucommentu
commenturlFT(uportucommentu
commenturl(	uFalseuloweruNoneuTrueu_debuguintu
ValueErroru_nowuappend(uselfu	attrs_setu
cookie_tuplesu
boolean_attrsuvalue_attrsucookie_attrsunameuvalueumax_age_setu
bad_cookieustandardurestukuvulc((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_normalized_cookie_tuplesEsl


		

	


u#CookieJar._normalized_cookie_tuplesc"Cs�|\}}}}|jdt�}|jdt�}|jdt�}	|jdt�}
|jdd�}|dk	r�yt|�}Wq�tk
r�dSYq�Xn|jdd�}|jdd�}
|jdd�}|jd	d�}|tk	r|d
krd}t|�}n~d}t|�}|j	d�}|dkr||d
kre|d|�}q||d|d�}nt
|�d
kr�d}n|tk	}d}|r�t|jd��}n|tkr�t
|�\}}|}n|jd�s
d|}nd}|	tk	rU|	dkr7t|�}	q[d}tjdd
|	�}	nd}	|
tkrvd}
d}
nR|
|jkr�y|j|||�Wntk
r�YnXtd|||�dSt||||	||||||||
|
|||�S(Nudomainupathuportuexpiresuversionusecureudiscarducommentu
commenturluu/iiu.u\s+u2Expiring cookie, domain='%s', path='%s', name='%s'FTi����(ugetuAbsentuNoneuintu
ValueErroruFalseuTrueuescape_pathurequest_pathurfindulenuboolu
startswithueff_request_hosturequest_portureusubu_nowuclearuKeyErroru_debuguCookie(uselfutupurequestunameuvalueustandardurestudomainupathuportuexpiresuversionusecureudiscarducommentucomment_urlupath_specifieduiudomain_specifiedudomain_initial_dotureq_hostuerhnuport_specified((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_cookie_from_cookie_tuple�s�
		
	

	u#CookieJar._cookie_from_cookie_tuplecCsR|j|�}g}x6|D].}|j||�}|r|j|�qqW|S(N(u_normalized_cookie_tuplesu_cookie_from_cookie_tupleuappend(uselfu	attrs_seturequestu
cookie_tuplesucookiesutupucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_cookies_from_attrs_sets
u!CookieJar._cookies_from_attrs_setcCsst|jdd�}|dkr1|jj}nx;|D]3}|jdkr8d|_|rkd|_qkq8q8WdS(Nurfc2109_as_netscapeiiT(ugetattru_policyuNoneurfc2965uversionuTrueurfc2109(uselfucookiesu
rfc2109_as_nsucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_process_rfc2109_cookiess
	u"CookieJar._process_rfc2109_cookiesc
Cs�|j�}|jdg�}|jdg�}|jj}|jj}|rV|s�|rd|s�|rr|s�|r�|r�gSy|jt|�|�}Wntk
r�t�g}YnX|r�|r�y|jt	|�|�}	Wntk
rt�g}	YnX|j
|	�|rsi}
x*|D]"}d|
|j|j
|jf<q,W|
dd�}t||	�}	n|	r�|j|	�q�n|S(uAReturn sequence of Cookie objects extracted from response object.uSet-Cookie2u
Set-CookiecSs"|j|j|jf}||kS(N(udomainupathuname(u	ns_cookieulookupukey((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuno_matching_rfc2965Csu3CookieJar.make_cookies.<locals>.no_matching_rfc2965N(uinfouget_allu_policyurfc2965unetscapeu_cookies_from_attrs_setusplit_header_wordsu	Exceptionu_warn_unhandled_exceptionuparse_ns_headersu_process_rfc2109_cookiesuNoneudomainupathunameufilteruextend(
uselfuresponseurequestuheadersurfc2965_hdrsuns_hdrsurfc2965unetscapeucookiesu
ns_cookiesulookupucookieuno_matching_rfc2965((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyumake_cookiessB



 uCookieJar.make_cookiesc
Csj|jj�zHttj��|j_|_|jj||�rT|j|�nWd|jj�XdS(u-Set a cookie if policy says it's OK to do so.N(	u
_cookies_lockuacquireuintutimeu_policyu_nowuset_oku
set_cookieurelease(uselfucookieurequest((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuset_cookie_if_okMs
uCookieJar.set_cookie_if_okc
Cs�|j}|jj�zi|j|kr8i||j<n||j}|j|krdi||j<n||j}|||j<Wd|jj�XdS(u?Set a cookie, without checking whether or not it should be set.N(u_cookiesu
_cookies_lockuacquireudomainupathunameurelease(uselfucookieucuc2uc3((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
set_cookieZs	


uCookieJar.set_cookiec
Cs�td|j��|jj�zrttj��|j_|_xL|j||�D]8}|jj	||�rUtd|�|j
|�qUqUWWd|jj�XdS(uAExtract cookies from response, where allowable given the request.uextract_cookies: %su setting cookie: %sN(u_debuguinfou
_cookies_lockuacquireuintutimeu_policyu_nowumake_cookiesuset_oku
set_cookieurelease(uselfuresponseurequestucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuextract_cookiesgs

uCookieJar.extract_cookiescCs�|dk	rH|dks$|dkr3td��n|j|||=nZ|dk	r�|dkrotd��n|j||=n"|dk	r�|j|=n	i|_dS(u�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.

        u8domain and path must be given to remove a cookie by nameu.domain must be given to remove cookies by pathN(uNoneu
ValueErroru_cookies(uselfudomainupathuname((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuclearus
uCookieJar.clearcCs_|jj�z=x6|D].}|jr|j|j|j|j�qqWWd|jj�XdS(u�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(u
_cookies_lockuacquireudiscarduclearudomainupathunameurelease(uselfucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuclear_session_cookies�s

	'uCookieJar.clear_session_cookiescCsq|jj�zOtj�}x<|D]4}|j|�r#|j|j|j|j�q#q#WWd|jj�XdS(u�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(	u
_cookies_lockuacquireutimeu
is_expireduclearudomainupathunameurelease(uselfunowucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuclear_expired_cookies�s


'uCookieJar.clear_expired_cookiescCs
t|j�S(N(u
deepvaluesu_cookies(uself((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__iter__�suCookieJar.__iter__cCs%d}x|D]}|d}q
W|S(u#Return number of contained cookies.ii((uselfuiucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__len__�s
uCookieJar.__len__cCsDg}x!|D]}|jt|��q
Wd|jdj|�fS(Nu<%s[%s]>u, (uappendurepru	__class__ujoin(uselfurucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__repr__�s
uCookieJar.__repr__cCsDg}x!|D]}|jt|��q
Wd|jdj|�fS(Nu<%s[%s]>u, (uappendustru	__class__ujoin(uselfurucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__str__�s
uCookieJar.__str__N(#u__name__u
__module__u__qualname__u__doc__ureucompileunon_word_reuquote_reustrict_domain_reu	domain_reudots_reuASCIIumagic_reuNoneu__init__u
set_policyu_cookies_for_domainu_cookies_for_requestu
_cookie_attrsuadd_cookie_headeru_normalized_cookie_tuplesu_cookie_from_cookie_tupleu_cookies_from_attrs_setu_process_rfc2109_cookiesumake_cookiesuset_cookie_if_oku
set_cookieuextract_cookiesuclearuclear_session_cookiesuclear_expired_cookiesu__iter__u__len__u__repr__u__str__(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu	CookieJar�s8;!a\	6

cBs|EeZdZdS(u	LoadErrorN(u__name__u
__module__u__qualname__(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu	LoadError�scBsn|EeZdZdZd
dd
dd�Zd
dddd�Zd
dddd�Zd
dddd	�Z	d
S(u
FileCookieJaru6CookieJar that can be loaded from and saved to a file.c	Cs^tj||�|dk	rBy|dWqBtd��YqBXn||_t|�|_dS(u}
        Cookies are NOT loaded from the named file until either the .load() or
        .revert() method is called.

        uufilename must be string-likeN(u	CookieJaru__init__uNoneu
ValueErrorufilenameuboolu	delayload(uselfufilenameu	delayloadupolicy((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu__init__�s	uFileCookieJar.__init__cCs
t��dS(uSave cookies to a file.N(uNotImplementedError(uselfufilenameuignore_discarduignore_expires((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyusave�suFileCookieJar.savecCsn|dkr6|jdk	r'|j}q6tt��nt|�}z|j||||�Wd|j�XdS(uLoad cookies from a file.N(uNoneufilenameu
ValueErroruMISSING_FILENAME_TEXTuopenu_really_loaduclose(uselfufilenameuignore_discarduignore_expiresuf((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuload�suFileCookieJar.loadcCs�|dkr6|jdk	r'|j}q6tt��n|jj�z]tj|j�}i|_y|j	|||�Wn$t
tfk
r�||_�YnXWd|jj�XdS(u�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(
uNoneufilenameu
ValueErroruMISSING_FILENAME_TEXTu
_cookies_lockuacquireucopyudeepcopyu_cookiesuloadu	LoadErroruIOErrorurelease(uselfufilenameuignore_discarduignore_expiresu	old_state((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyurevert�s
		uFileCookieJar.revertNF(
u__name__u
__module__u__qualname__u__doc__uNoneuFalseu__init__usaveuloadurevert(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
FileCookieJar�scCs�|j|jfd|jfd|jfg}|jd
k	rU|jd|jf�n|jrn|jd�n|jr�|jd�n|j	r�|jd�n|j
r�|jd�n|jr�|jdtt
|j��f�n|jr|jd�n|jr"|jd
|jf�n|jrD|jd|jf�nt|jj��}x.|D]&}|j|t|j|�f�q`W|jdt|j�f�t|g�S(u�Return string representation of Cookie in an the LWP cookie file format.

    Actually, the format is extended a bit -- see module docstring.

    upathudomainuportu	path_specu	port_specu
domain_dotusecureuexpiresudiscarducommentu
commenturluversionN(u	path_specN(u	port_specN(u
domain_dotN(usecureN(udiscardN(unameuvalueupathudomainuportuNoneuappendupath_specifieduport_specifiedudomain_initial_dotusecureuexpiresu	time2isozufloatudiscarducommentucomment_urlusortedu_restukeysustruversionujoin_header_words(ucookieuhukeysuk((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyulwp_cookie_strs6									
$ulwp_cookie_strcBsM|EeZdZdZd	d	dd�Zdd
d
dd�Zdd�Z	dS(uLWPCookieJaruZ
    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(u�Return cookies as a string of "\n"-separated "Set-Cookie3" headers.

        ignore_discard and ignore_expires: see docstring for FileCookieJar.save

        uSet-Cookie3: %su
u(utimeudiscardu
is_expireduappendulwp_cookie_strujoin(uselfuignore_discarduignore_expiresunowurucookie((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu
as_lwp_str/s
uLWPCookieJar.as_lwp_strc
Cs�|dkr6|jdk	r'|j}q6tt��nt|d�}z*|jd�|j|j||��Wd|j�XdS(Nuwu#LWP-Cookies-2.0
(uNoneufilenameu
ValueErroruMISSING_FILENAME_TEXTuopenuwriteu
as_lwp_struclose(uselfufilenameuignore_discarduignore_expiresuf((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyusave?s
uLWPCookieJar.savecCs|j�}|jj|�s7d|}t|��ntj�}d}d}	d}
yvxo|j�}|dkrwPn|j|�s�q[n|t|�d�j�}xt|g�D]}|d\}
}i}i}x|	D]}d||<q�Wx�|dd�D]�\}}|dk	r-|j�}nd}||
ksK||	krT|}n||	kr�|dkrud}n|||<q||
kr�|||<q|||<qW|j
}|d�}|d�}|dk	r�t|�}n|dkr�d}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[WnCtk
r��Yn/tk
rt�td||f��YnXdS(Nu5%r does not look like a Set-Cookie3 (LWP) format fileuSet-Cookie3:u	port_specu	path_specu
domain_dotusecureudiscarduversionuportupathudomainuexpiresucommentu
commenturluiiu.u&invalid Set-Cookie3 format file %r: %r(u	port_specu	path_specu
domain_dotusecureudiscard(uversionuportupathudomainuexpiresucommentu
commenturlFT(ureadlineumagic_reusearchu	LoadErrorutimeu
startswithulenustripusplit_header_wordsuFalseuNoneuloweruTrueugetuiso2timeuCookieudiscardu
is_expiredu
set_cookieuIOErroru	Exceptionu_warn_unhandled_exception(uselfufufilenameuignore_discarduignore_expiresumagicumsgunowuheaderu
boolean_attrsuvalue_attrsulineudataunameuvalueustandardurestukuvulcuhuexpiresudiscardudomainudomain_specifieduc((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_really_loadNs�
		

						

uLWPCookieJar._really_loadNTF(
u__name__u
__module__u__qualname__u__doc__uTrueu
as_lwp_struNoneuFalseusaveu_really_load(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuLWPCookieJar"scBsP|EeZdZdZejd�ZdZdd�Zdd	d	dd�ZdS(
uMozillaCookieJaru�

    WARNING: you may want to backup your browser's cookies file if you use
    this class to save cookies.  I *think* it works, but there have been
    bugs in the past!

    This class differs from CookieJar only in the format it uses to save and
    load cookies to and from a file.  This class uses the Mozilla/Netscape
    `cookies.txt' format.  lynx uses this file format, too.

    Don't expect cookies saved while the browser is running to be noticed by
    the browser (in fact, Mozilla on unix will overwrite your saved cookies if
    you change them on disk while it's running; on Windows, you probably can't
    save at all while the browser is running).

    Note that the Mozilla/Netscape format will downgrade RFC2965 cookies to
    Netscape cookies on saving.

    In particular, the cookie version and port number information is lost,
    together with information about whether or not Path, Port and Discard were
    specified by the Set-Cookie2 (or Set-Cookie) header, and whether or not the
    domain as set in the HTTP header started with a dot (yes, I'm aware some
    domains in Netscape files start with a dot and some don't -- trust me, you
    really don't want to know any more about this).

    Note that though Mozilla and Netscape use the same format, they use
    slightly different headers.  The class saves cookies using the Netscape
    header by default (Mozilla can cope with that).

    u#( Netscape)? HTTP Cookie Fileur# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file!  Do not edit.

cCstj�}|j�}|jj|�sG|j�td|��nytxm|j�}|dkriPn|jd�r�|dd�}n|j�jd
�sM|j�dkr�qMn|j	d�\}}	}
}}}
}|dk}|	dk}	|
dkr|}
d}n|jd	�}d}|dkr?d}d}nt
d
|
|dd||	||
d|||ddi�}|r�|jr�qMn|r�|j|�r�qMn|j|�qMWnCtk
r��Yn/tk
rt�td||f��YnXdS(Nu4%r does not look like a Netscape format cookies fileuu
iu#u$u	uTRUEu.iu+invalid Netscape format cookies file %r: %ri����(u#u$FT(utimeureadlineumagic_reusearchucloseu	LoadErroruendswithustripu
startswithusplituNoneuFalseuTrueuCookieudiscardu
is_expiredu
set_cookieuIOErroru	Exceptionu_warn_unhandled_exception(uselfufufilenameuignore_discarduignore_expiresunowumagiculineudomainudomain_specifiedupathusecureuexpiresunameuvalueuinitial_dotudiscarduc((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu_really_load�sb

$				

uMozillaCookieJar._really_loadcCs�|dkr6|jdk	r'|j}q6tt��nt|d�}z+|j|j�tj�}x|D]}|r�|jr�qkn|r�|j	|�r�qkn|j
r�d}nd}|jjd�r�d}nd}|j
dk	r�t|j
�}	nd}	|jdkr$d}
|j}n|j}
|j}|jdj|j||j||	|
|g�d�qkWWd|j�XdS(NuwuTRUEuFALSEu.uu	u
(uNoneufilenameu
ValueErroruMISSING_FILENAME_TEXTuopenuwriteuheaderutimeudiscardu
is_expiredusecureudomainu
startswithuexpiresustruvalueunameujoinupathuclose(uselfufilenameuignore_discarduignore_expiresufunowucookieusecureuinitial_dotuexpiresunameuvalue((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyusaves@
					uMozillaCookieJar.saveNF(u__name__u
__module__u__qualname__u__doc__ureucompileumagic_reuheaderu_really_loaduNoneuFalseusave(u
__locals__((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyuMozillaCookieJar�s
B([u__doc__u__all__ucopyudatetimeureutimeuurllib.parseuurllibuurllib.requestu	threadingu
_threadinguImportErrorudummy_threadinguhttp.clientuhttpucalendarutimegmuFalseudebuguNoneuloggeru_debugustruclientu	HTTP_PORTuDEFAULT_HTTP_PORTuMISSING_FILENAME_TEXTu_warn_unhandled_exceptionu
EPOCH_YEARu_timegmuDAYSuMONTHSuMONTHS_LOWERumonthuappenduloweru	time2isozu
time2netscapeu	UTC_ZONESucompileuASCIIuTIMEZONE_REuoffset_from_tz_stringu	_str2timeuSTRICT_DATE_REuIu
WEEKDAY_REuXuLOOSE_HTTP_DATE_REu	http2timeuISO_DATE_REuiso2timeu	unmatcheduHEADER_TOKEN_REuHEADER_QUOTED_VALUE_REuHEADER_VALUE_REuHEADER_ESCAPE_REusplit_header_wordsuHEADER_JOIN_ESCAPE_REujoin_header_wordsustrip_quotesuparse_ns_headersuIPV4_REuis_HDNudomain_matchuliberal_is_HDNuuser_domain_matchucut_port_reurequest_hostueff_request_hosturequest_pathurequest_portuHTTP_PATH_SAFEuESCAPED_CHAR_REuuppercase_escaped_charuescape_pathureachuis_third_partyuCookieuCookiePolicyuDefaultCookiePolicyuvals_sorted_by_keyu
deepvaluesuAbsentu	CookieJaruIOErroru	LoadErroru
FileCookieJarulwp_cookie_struLWPCookieJaruMozillaCookieJar(((u3/opt/alt/python33/lib64/python3.3/http/cookiejar.pyu<module>s�


"58!U4'

#b!�R��=|

Hacked By AnonymousFox1.0, Coded By AnonymousFox