
     f                        d dl mZ ddlmZ ddlmZ d Z G d dee          Z G d d	ee          Z G d
 de          Z	ddl
mZ dS )    )annotations   )ImmutableDictMixin)UpdateDictMixinc                J     t           fd fd fdd           S )zReturn a new property object for a cache header. Useful if you
    want to add support for a cache extension in a subclass.

    .. versionchanged:: 2.0
        Renamed from ``cache_property``.
    c                2    |                                S N)_get_cache_value)xemptykeytypes    h/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/werkzeug/datastructures/cache_control.py<lambda>z(cache_control_property.<locals>.<lambda>   s    !$$S%66     c                2    |                      |          S r	   )_set_cache_value)r   vr   r   s     r   r   z(cache_control_property.<locals>.<lambda>   s    Q''Q55 r   c                .    |                                S r	   )_del_cache_value)r   r   s    r   r   z(cache_control_property.<locals>.<lambda>   s    !$$S)) r   zaccessor for )property)r   r   r   s   ```r   cache_control_propertyr      sQ     66666655555))))	  r   c                      e Zd ZdZ eddd          Z edde          Z edde          Z	 eddd          Z
dd
Zd Zd Zd Zd Zd Zd Z ee          ZdS )_CacheControla  Subclass of a dict that stores values for a Cache-Control header.  It
    has accessors for all the cache-control directives specified in RFC 2616.
    The class does not differentiate between request and response directives.

    Because the cache-control directives in the HTTP header use dashes the
    python descriptors use underscores for that.

    To get a header of the :class:`CacheControl` object again you can convert
    the object into a string or call the :meth:`to_header` method.  If you plan
    to subclass it and add your own items have a look at the sourcecode for
    that class.

    .. versionchanged:: 2.1.0
        Setting int properties such as ``max_age`` will convert the
        value to an int.

    .. versionchanged:: 0.4

       Setting `no_cache` or `private` to boolean `True` will set the implicit
       none-value which is ``*``:

       >>> cc = ResponseCacheControl()
       >>> cc.no_cache = True
       >>> cc
       <ResponseCacheControl 'no-cache'>
       >>> cc.no_cache
       '*'
       >>> cc.no_cache = None
       >>> cc
       <ResponseCacheControl ''>

       In versions before 0.5 the behavior documented here affected the now
       no longer existing `CacheControl` class.
    zno-cache*Nzno-storezmax-agezno-transform c                `    t                               | |pd           || _        |d u| _        d S )Nr   )dict__init__	on_updateprovided)selfvaluesr!   s      r   r    z_CacheControl.__init__?   s1    dFLb)))"d*r   c                    |t           u r|| v S || v r-| |         }||S |	  ||          }n# t          $ r Y nw xY w|S dS +Used internally by the accessor properties.N)bool
ValueError)r#   r   r   r   values        r   r
   z_CacheControl._get_cache_valueD   su    4<<$;$;;IE}! DKKEE!   DLts   - 
::c                    |t           u r!|rd| |<   dS |                     |d           dS ||                     |d           dS |du rd| |<   dS | ||          | |<   dS || |<   dS )r'   NT)r(   pop)r#   r   r*   r   s       r   r   z_CacheControl._set_cache_valueT   s    4<< $ S			d#####}d#####$ S			# $UDIII %DIIIr   c                    || v r| |= dS dS r&   r   )r#   r   s     r   r   z_CacheControl._del_cache_valuef   s    $;;S			 ;r   c                *    t          j        |           S )z6Convert the stored values into a cache control header.)httpdump_headerr#   s    r   	to_headerz_CacheControl.to_headerk   s    %%%r   c                *    |                                  S r	   )r2   r1   s    r   __str__z_CacheControl.__str__o   s    ~~r   c                    d                     d t          |                                           D                       }dt          |           j         d| dS )N c              3  *   K   | ]\  }}| d |V  dS )=Nr   ).0kr   s      r   	<genexpr>z)_CacheControl.__repr__.<locals>.<genexpr>s   s0      HH41aQ,,,,HHHHHHr   <>)joinsorteditemsr   __name__)r#   kv_strs     r   __repr__z_CacheControl.__repr__r   sT    HH6$**,,3G3GHHHHH24::&222222r   )r   N)rA   
__module____qualname____doc__r   no_cacher(   no_storeintmax_ageno_transformr    r
   r   r   r2   r4   rC   staticmethodcache_propertyr   r   r   r   r      s        ! !F &%j#t<<H%%j$==H$$YC88G)).$EEL+ + + +
   & & &$  
& & &     3 3 3 "\"899NNNr   r   c                  `    e Zd ZdZ edde          Z edde          Z edde          Z	dS )RequestCacheControla  A cache control for requests.  This is immutable and gives access
    to all the request-relevant cache control headers.

    To get a header of the :class:`RequestCacheControl` object again you can
    convert the object into a string or call the :meth:`to_header` method.  If
    you plan to subclass it and add your own items have a look at the sourcecode
    for that class.

    .. versionchanged:: 2.1.0
        Setting int properties such as ``max_age`` will convert the
        value to an int.

    .. versionadded:: 0.5
       In previous versions a `CacheControl` class existed that was used
       both for request and response.
    z	max-staler   z	min-freshzonly-if-cachedN)
rA   rD   rE   rF   r   rI   	max_stale	min_freshr(   only_if_cachedr   r   r   rO   rO   y   sW         " '&{C==I&&{C==I++,<dDIINNNr   rO   c                      e Zd ZdZ edde          Z eddd          Z edde          Z edde          Z	 edde
          Z ed	de          ZdS )
ResponseCacheControla  A cache control for responses.  Unlike :class:`RequestCacheControl`
    this is mutable and gives access to response-relevant cache control
    headers.

    To get a header of the :class:`ResponseCacheControl` object again you can
    convert the object into a string or call the :meth:`to_header` method.  If
    you plan to subclass it and add your own items have a look at the sourcecode
    for that class.

    .. versionchanged:: 2.1.1
        ``s_maxage`` converts the value to an int.

    .. versionchanged:: 2.1.0
        Setting int properties such as ``max_age`` will convert the
        value to an int.

    .. versionadded:: 0.5
       In previous versions a `CacheControl` class existed that was used
       both for request and response.
    publicNprivater   zmust-revalidatezproxy-revalidatezs-maxage	immutable)rA   rD   rE   rF   r   r(   rU   rV   must_revalidateproxy_revalidaterI   s_maxagerW   r   r   r   rT   rT      s         * $#HdD99F$$YT::G,,->dKKO--.@$MM%%j$<<H&&{D$??IIIr   rT      )r/   N)
__future__r   mixinsr   r   r   r   r   rO   rT    r/   r   r   r   <module>r_      s    " " " " " " & & & & & & # # # # # #  `: `: `: `: `:OT `: `: `:FJ J J J J,m J J J.@ @ @ @ @= @ @ @>        r   