<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

Yf>S                 @   s  d  Z  d d l Z d d l Z d d d g Z d j Z d j Z d j Z d	 d
   Z Gd d   d e	  Z
 e j e j d Z e d Z d d   e e d   e e e e   D Z e j e d  d e d  d i  e j d e j e   j Z d d   Z e j d  Z e j d  Z d d   Z d d d d d  d! d" g Z d d# d$ d% d& d' d( d) d* d+ d, d- d. g Z d e e d/ d0  Z Gd1 d2   d2 e   Z! d3 Z" e" d4 Z# e j d5 e" d6 e# d7 e j$  Z% Gd8 d   d e   Z& Gd9 d   d e&  Z' d S):a.
  
Here's a sample session to show how to use this module.
At the moment, this is the only documentation.

The Basics
----------

Importing is easy...

   >>> from http import cookies

Most of the time you start by creating a cookie.

   >>> C = cookies.SimpleCookie()

Once you've created your Cookie, you can add values just as if it were
a dictionary.

   >>> C = cookies.SimpleCookie()
   >>> C["fig"] = "newton"
   >>> C["sugar"] = "wafer"
   >>> C.output()
   'Set-Cookie: fig=newton\r\nSet-Cookie: sugar=wafer'

Notice that the printable representation of a Cookie is the
appropriate format for a Set-Cookie: header.  This is the
default behavior.  You can change the header and printed
attributes by using the .output() function

   >>> C = cookies.SimpleCookie()
   >>> C["rocky"] = "road"
   >>> C["rocky"]["path"] = "/cookie"
   >>> print(C.output(header="Cookie:"))
   Cookie: rocky=road; Path=/cookie
   >>> print(C.output(attrs=[], header="Cookie:"))
   Cookie: rocky=road

The load() method of a Cookie extracts cookies from a string.  In a
CGI script, you would use this method to extract the cookies from the
HTTP_COOKIE environment variable.

   >>> C = cookies.SimpleCookie()
   >>> C.load("chips=ahoy; vienna=finger")
   >>> C.output()
   'Set-Cookie: chips=ahoy\r\nSet-Cookie: vienna=finger'

The load() method is darn-tootin smart about identifying cookies
within a string.  Escaped quotation marks, nested semicolons, and other
such trickeries do not confuse it.

   >>> C = cookies.SimpleCookie()
   >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
   >>> print(C)
   Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;"

Each element of the Cookie also supports all of the RFC 2109
Cookie attributes.  Here's an example which sets the Path
attribute.

   >>> C = cookies.SimpleCookie()
   >>> C["oreo"] = "doublestuff"
   >>> C["oreo"]["path"] = "/"
   >>> print(C)
   Set-Cookie: oreo=doublestuff; Path=/

Each dictionary element has a 'value' attribute, which gives you
back the value associated with the key.

   >>> C = cookies.SimpleCookie()
   >>> C["twix"] = "none for you"
   >>> C["twix"].value
   'none for you'

The SimpleCookie expects that all values should be standard strings.
Just to be sure, SimpleCookie invokes the str() builtin to convert
the value to a string, when the values are set dictionary-style.

   >>> C = cookies.SimpleCookie()
   >>> C["number"] = 7
   >>> C["string"] = "seven"
   >>> C["number"].value
   '7'
   >>> C["string"].value
   'seven'
   >>> C.output()
   'Set-Cookie: number=7\r\nSet-Cookie: string=seven'

Finis.
    NCookieError
BaseCookieSimpleCookie z;  c             C   s0   d d  l  } d |  } | j | t d d d  S)Nr   zvThe .%s setter is deprecated. The attribute will be read-only in future releases. Please use the set() method instead.
stacklevel   )warningswarnDeprecationWarning)setterr	   msg r   1/opt/alt/python35/lib64/python3.5/http/cookies.py_warn_deprecated_setter   s    r   c               @   s   e  Z d  Z d S)r   N)__name__
__module____qualname__r   r   r   r   r      s   z!#$%&'*+-.^_`|~:z ()/<=>?@[]{}c             C   s   i  |  ] } d  | |  q S)z\%03or   ).0nr   r   r   
<dictcomp>   s   	r      "z\"\z\\z[%s]+c             C   s5   |  d k s t  |   r |  Sd |  j t  d Sd S)zQuote a string for use in a cookie header.

    If the string does not need to be double-quoted, then just return the
    string.  Otherwise, surround the string in doublequotes and quote
    (with a \) special characters.
    Nr   )_is_legal_key	translate_Translator)strr   r   r   _quote   s    r   z\\[0-3][0-7][0-7]z[\\].c             C   s  |  d  k s t  |   d k  r" |  S|  d d k sB |  d d k rF |  S|  d d  }  d } t  |   } g  } x?d | k o | k  n rt j |  |  } t j |  |  } | r | r | j |  | d    Pd	 } } | r | j d  } | r| j d  } | r]| s$| | k  r]| j |  | |   | j |  | d  | d } qq | j |  | |   | j t t |  | d | d  d    | d } qq Wt |  S)
N   r   r            r#   r#   )	len
_OctalPattsearch
_QuotePattappendstartchrint	_nulljoin)r   ir   resZo_matchZq_matchjkr   r   r   _unquote   s6     
.r1   ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc          	   C   so   d d l  m } m  } |   } | | |   \	 } } } }	 }
 } } } } d | | | | | | |	 |
 | f S)Nr   )gmtimetimez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r3   r2   )ZfutureZweekdaynameZ	monthnamer2   r3   ZnowZyearZmonthZdayZhhZmmZssZwdyzr   r   r   _getdate   s
    	+r6   c               @   s  e  Z d  Z d Z d d d d d d d d d	 d
 d d d d d d i Z d d h Z d d   Z e d d    Z e j	 d d    Z e d d    Z
 e
 j	 d d    Z
 e d d    Z e j	 d d    Z d d   Z d d d   Z d! d"   Z e j Z d# d$   Z d% d&   Z d' d(   Z e d) d*  Z d+ d,   Z d- d.   Z d d/ d0 d1  Z e Z d2 d3   Z d d4 d5  Z d d6 d7  Z d S)8Morsela  A class to hold ONE (key, value) pair.

    In a cookie, each such pair may have several attributes, so this class is
    used to keep the attributes associated with the appropriate key,value pair.
    This class also includes a coded_value attribute, which is used to hold
    the network representation of the value.  This is most useful when Python
    objects are pickled for network transit.
    expirespathZPathZcommentCommentZdomainZDomainzmax-agezMax-AgeZsecureZSecureZhttponlyZHttpOnlyversionZVersionc             C   sB   d  |  _  |  _ |  _ x$ |  j D] } t j |  | d  q! Wd  S)Nr   )_key_value_coded_value	_reserveddict__setitem__)selfkeyr   r   r   __init__&  s    zMorsel.__init__c             C   s   |  j  S)N)r<   )rB   r   r   r   rC   .  s    z
Morsel.keyc             C   s   t  d  | |  _ d  S)NrC   )r   r<   )rB   rC   r   r   r   rC   2  s    
c             C   s   |  j  S)N)r=   )rB   r   r   r   value7  s    zMorsel.valuec             C   s   t  d  | |  _ d  S)NrE   )r   r=   )rB   rE   r   r   r   rE   ;  s    
c             C   s   |  j  S)N)r>   )rB   r   r   r   coded_value@  s    zMorsel.coded_valuec             C   s   t  d  | |  _ d  S)NrF   )r   r>   )rB   rF   r   r   r   rF   D  s    
c             C   sE   | j    } | |  j k r. t d | f   t j |  | |  d  S)NzInvalid attribute %r)lowerr?   r   r@   rA   )rB   KVr   r   r   rA   I  s    zMorsel.__setitem__Nc             C   sA   | j    } | |  j k r. t d | f   t j |  | |  S)NzInvalid attribute %r)rG   r?   r   r@   
setdefault)rB   rC   valr   r   r   rJ   O  s    zMorsel.setdefaultc             C   sY   t  | t  s t St j |  |  oX |  j | j k oX |  j | j k oX |  j | j k S)N)
isinstancer7   NotImplementedr@   __eq__r=   r<   r>   )rB   morselr   r   r   rN   U  s    zMorsel.__eq__c             C   s0   t    } t j | |   | j j |  j  | S)N)r7   r@   update__dict__)rB   rO   r   r   r   copy_  s    	zMorsel.copyc             C   su   i  } xX t  |  j   D]D \ } } | j   } | |  j k rS t d | f   | | | <q Wt  j |  |  d  S)NzInvalid attribute %r)r@   itemsrG   r?   r   rP   )rB   valuesdatarC   rK   r   r   r   rP   e  s    zMorsel.updatec             C   s   | j    |  j k S)N)rG   r?   )rB   rH   r   r   r   isReservedKeyn  s    zMorsel.isReservedKeyc             C   s   | t  k r. d d  l } | j d t d d | j   |  j k rV t d | f   t |  su t d | f   | |  _ | |  _	 | |  _
 d  S)Nr   zSLegalChars parameter is deprecated, ignored and will be removed in future versions.r   r   z Attempt to set a reserved key %rzIllegal key %r)_LegalCharsr	   r
   r   rG   r?   r   r   r<   r=   r>   )rB   rC   rK   Z	coded_valZ
LegalCharsr	   r   r   r   setq  s    		z
Morsel.setc             C   s   d |  j  d |  j d |  j i S)NrC   rE   rF   )r<   r=   r>   )rB   r   r   r   __getstate__  s    		zMorsel.__getstate__c             C   s+   | d |  _  | d |  _ | d |  _ d  S)NrC   rE   rF   )r<   r=   r>   )rB   stater   r   r   __setstate__  s    zMorsel.__setstate__zSet-Cookie:c             C   s   d | |  j  |  f S)Nz%s %s)OutputString)rB   attrsheaderr   r   r   output  s    zMorsel.outputc             C   s   d |  j  j |  j   f S)Nz<%s: %s>)	__class__r   r\   )rB   r   r   r   __repr__  s    zMorsel.__repr__c             C   s   d |  j  |  j d d  S)Nz
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = "%s";
        // end hiding -->
        </script>
        r   z\")r\   replace)rB   r]   r   r   r   	js_output  s    zMorsel.js_outputc             C   sQ  g  } | j  } | d |  j |  j f  | d  k r> |  j } t |  j    } x | D] \ } } | d k rr qW | | k r qW | d k r t | t  r | d |  j | t |  f  qW | d k r t | t  r | d |  j | | f  qW | |  j	 k r(| rC| t
 |  j |   qW | d |  j | | f  qW Wt |  S)Nz%s=%sr   r8   zmax-agez%s=%d)r(   rC   rF   r?   sortedrS   rL   r+   r6   _flagsr   _semispacejoin)rB   r]   resultr(   rS   rC   rE   r   r   r   r\     s(    		$zMorsel.OutputString)r   r   r   __doc__r?   re   rD   propertyrC   r   rE   rF   rA   rJ   rN   object__ne__rR   rP   rV   rW   rX   rY   r[   r_   __str__ra   rc   r\   r   r   r   r   r7     s@   		
r7   z,\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=z\[\]z
    (?x)                           # This is a verbose pattern
    \s*                            # Optional whitespace at start of cookie
    (?P<key>                       # Start of group 'key'
    [a	  ]+?   # Any word of at least one letter
    )                              # End of group 'key'
    (                              # Optional group: there may not be a value.
    \s*=\s*                          # Equal Sign
    (?P<val>                         # Start of group 'val'
    "(?:[^\\"]|\\.)*"                  # Any doublequoted string
    |                                  # or
    \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT  # Special case for "expires" attr
    |                                  # or
    [a-  ]*      # Any word or empty string
    )                                # End of group 'val'
    )?                             # End of optional value group
    \s*                            # Any number of spaces.
    (\s+|;|$)                      # Ending either at space, semicolon, or EOS.
    c               @   s   e  Z d  Z d Z d d   Z d d   Z d d d  Z d	 d
   Z d d   Z d d d d d  Z	 e	 Z
 d d   Z d d d  Z d d   Z e d d  Z d S)r   z'A container class for a set of Morsels.c             C   s
   | | f S)a
  real_value, coded_value = value_decode(STRING)
        Called prior to setting a cookie's value from the network
        representation.  The VALUE is the value read from HTTP
        header.
        Override this function to modify the behavior of cookies.
        r   )rB   rK   r   r   r   value_decode  s    zBaseCookie.value_decodec             C   s   t  |  } | | f S)zreal_value, coded_value = value_encode(VALUE)
        Called prior to setting a cookie's value from the dictionary
        representation.  The VALUE is the value being assigned.
        Override this function to modify the behavior of cookies.
        )r   )rB   rK   strvalr   r   r   value_encode  s    zBaseCookie.value_encodeNc             C   s   | r |  j  |  d  S)N)load)rB   inputr   r   r   rD     s    zBaseCookie.__init__c             C   s?   |  j  | t    } | j | | |  t j |  | |  d S)z+Private method for setting a cookie's valueN)getr7   rX   r@   rA   )rB   rC   Z
real_valuerF   Mr   r   r   Z__set  s    zBaseCookie.__setc             C   sQ   t  | t  r% t j |  | |  n( |  j |  \ } } |  j | | |  d S)zDictionary style assignment.N)rL   r7   r@   rA   ro   _BaseCookie__set)rB   rC   rE   rvalcvalr   r   r   rA     s    zBaseCookie.__setitem__zSet-Cookie:z
c             C   sU   g  } t  |  j    } x- | D]% \ } } | j | j | |   q W| j |  S)z"Return a string suitable for HTTP.)rd   rS   r(   r_   join)rB   r]   r^   seprg   rS   rC   rE   r   r   r   r_     s
    zBaseCookie.outputc             C   si   g  } t  |  j    } x4 | D], \ } } | j d | t | j  f  q Wd |  j j t |  f S)Nz%s=%sz<%s: %s>)rd   rS   r(   reprrE   r`   r   
_spacejoin)rB   lrS   rC   rE   r   r   r   ra     s
    $zBaseCookie.__repr__c             C   sO   g  } t  |  j    } x* | D]" \ } } | j | j |   q Wt |  S)z(Return a string suitable for JavaScript.)rd   rS   r(   rc   r,   )rB   r]   rg   rS   rC   rE   r   r   r   rc     s
    zBaseCookie.js_outputc             C   sJ   t  | t  r |  j |  n' x$ | j   D] \ } } | |  | <q, Wd S)zLoad cookies from a string (presumably HTTP_COOKIE) or
        from a dictionary.  Loading cookies from a dictionary 'd'
        is equivalent to calling:
            map(Cookie.__setitem__, d.keys(), d.values())
        N)rL   r   _BaseCookie__parse_stringrS   )rB   ZrawdatarC   rE   r   r   r   rp   %  s
    zBaseCookie.loadc             C   s  d } t  |  } g  } d } d } d } xZd | k oD | k  n r| j | |  }	 |	 sb P|	 j d  |	 j d  }
 } |	 j d  } |
 d d k r | s q- | j | |
 d d   | f  q- |
 j   t j k rK| s d  S| d  k r,|
 j   t j k r%| j | |
 d f  qHd  Sq| j | |
 t	 |  f  q- | d  k	 r| j | |
 |  j
 |  f  d } q- d  Sq- Wd  } xY | D]Q \ } }
 } | | k r| | |
 <q| \ } } |  j |
 | |  |  |
 } qWd  S)	Nr   Fr    r   rC   rK   $T)r$   matchgroupendr(   rG   r7   r?   re   r1   rm   rt   )rB   r   Zpattr-   r   Zparsed_itemsZmorsel_seenZTYPE_ATTRIBUTEZTYPE_KEYVALUEr~   rC   rE   rs   tpru   rv   r   r   r   Z__parse_string3  sF    #	zBaseCookie.__parse_string)r   r   r   rh   rm   ro   rD   rt   rA   r_   rl   ra   rc   rp   _CookiePatternr|   r   r   r   r   r     s   			c               @   s.   e  Z d  Z d Z d d   Z d d   Z d S)r   z
    SimpleCookie supports strings as cookie values.  When setting
    the value using the dictionary assignment notation, SimpleCookie
    calls the builtin str() to convert the value to a string.  Values
    received from HTTP are kept as strings.
    c             C   s   t  |  | f S)N)r1   )rB   rK   r   r   r   rm   w  s    zSimpleCookie.value_decodec             C   s   t  |  } | t |  f S)N)r   r   )rB   rK   rn   r   r   r   ro   z  s    zSimpleCookie.value_encodeN)r   r   r   rh   rm   ro   r   r   r   r   r   p  s   )(rh   restring__all__rw   r,   rf   rz   r   	Exceptionr   Zascii_lettersZdigitsrW   Z_UnescapedCharsrX   rangemapordr   rP   compileescape	fullmatchr   r   r%   r'   r1   Z_weekdaynameZ
_monthnamer6   r@   r7   Z_LegalKeyCharsZ_LegalValueCharsASCIIr   r   r   r   r   r   r   <module>   sB   				
	)2
