o
    q>¨eM  ã                   @  s’   d dl mZ d dlZd dlmZ d dlmZ d dlm	Z
 ddlmZ ddlmZ dd	lmZ ejr7d d
lmZ G dd„ deƒZG dd„ de
ƒZ	dS )é    )ÚannotationsN)Ú
BadRequest)ÚRequest)ÚResponseé   )Újson)Úcurrent_app)Ú_split_blueprint_path)ÚRulec                      sš   e Zd ZU dZeZded< dZded< dZded< dZ	d	ed
< e
ddd„ƒZe
ddd„ƒZe
ddd„ƒZe
d dd„ƒZd!‡ fdd„Zd"‡ fdd„Z‡  ZS )#r   aÎ  The request object used by default in Flask.  Remembers the
    matched endpoint and view arguments.

    It is what ends up as :class:`~flask.request`.  If you want to replace
    the request object used you can subclass this and set
    :attr:`~flask.Flask.request_class` to your subclass.

    The request object is a :class:`~werkzeug.wrappers.Request` subclass and
    provides all of the attributes Werkzeug defines plus a few Flask
    specific ones.
    út.AnyÚjson_moduleNzRule | NoneÚurl_rulezdict[str, t.Any] | NoneÚ	view_argszException | NoneÚrouting_exceptionÚreturnú
int | Nonec                 C  s   t rt jd S dS )z8Read-only view of the ``MAX_CONTENT_LENGTH`` config key.ÚMAX_CONTENT_LENGTHN)r   Úconfig©Úself© r   úO/var/www/bmteknikk.ddns.net/venv/lib/python3.10/site-packages/flask/wrappers.pyÚmax_content_length6   s   
zRequest.max_content_lengthú
str | Nonec                 C  s   | j dur	| j jS dS )a  The endpoint that matched the request URL.

        This will be ``None`` if matching failed or has not been
        performed yet.

        This in combination with :attr:`view_args` can be used to
        reconstruct the same URL or a modified URL.
        N)r   Úendpointr   r   r   r   r   >   s   

zRequest.endpointc                 C  s(   | j }|durd|v r| d¡d S dS )aj  The registered name of the current blueprint.

        This will be ``None`` if the endpoint is not part of a
        blueprint, or if URL matching failed or has not been performed
        yet.

        This does not necessarily match the name the blueprint was
        created with. It may have been nested, or registered with a
        different name.
        NÚ.r   )r   Ú
rpartition)r   r   r   r   r   Ú	blueprintM   s   zRequest.blueprintú	list[str]c                 C  s   | j }|du r	g S t|ƒS )zëThe registered names of the current blueprint upwards through
        parent blueprints.

        This will be an empty list if there is no current blueprint, or
        if URL matching failed.

        .. versionadded:: 2.0.1
        N)r   r	   )r   Únamer   r   r   Ú
blueprints`   s   
zRequest.blueprintsÚNonec                   sL   t ƒ  ¡  trtjr | jdkr"| js$ddlm} || ƒ d S d S d S d S d S )Nzmultipart/form-datar   )Úattach_enctype_error_multidict)ÚsuperÚ_load_form_datar   ÚdebugÚmimetypeÚfilesÚdebughelpersr"   )r   r"   ©Ú	__class__r   r   r$   q   s   
ÿþ
ÿøzRequest._load_form_dataÚeúValueError | Nonec              
     s<   zt ƒ  |¡W S  ty } z
trtjr‚ tƒ |‚d }~ww )N)r#   Úon_json_loading_failedr   r   r%   )r   r+   r)   r   r   r-   €   s   
€üzRequest.on_json_loading_failed)r   r   )r   r   )r   r   )r   r!   )r+   r,   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__annotations__r   r   r   Úpropertyr   r   r   r    r$   r-   Ú__classcell__r   r   r)   r   r      s    
 r   c                      s<   e Zd ZU dZdZded< eZdZe	d
‡ fdd	„ƒZ
‡  ZS )r   a¬  The response object that is used by default in Flask.  Works like the
    response object from Werkzeug but is set to have an HTML mimetype by
    default.  Quite often you don't have to create this object yourself because
    :meth:`~flask.Flask.make_response` will take care of that for you.

    If you want to replace the response object used you can subclass this and
    set :attr:`~flask.Flask.response_class` to your subclass.

    .. versionchanged:: 1.0
        JSON support is added to the response, like the request. This is useful
        when testing to get the test client response data as JSON.

    .. versionchanged:: 1.0

        Added :attr:`max_cookie_size`.
    z	text/htmlr   Údefault_mimetypeFr   Úintc                   s   t rt jd S tƒ jS )zŸRead-only view of the :data:`MAX_COOKIE_SIZE` config key.

        See :attr:`~werkzeug.wrappers.Response.max_cookie_size` in
        Werkzeug's docs.
        ÚMAX_COOKIE_SIZE)r   r   r#   Úmax_cookie_sizer   r)   r   r   r8   ¢   s   
zResponse.max_cookie_size)r   r6   )r.   r/   r0   r1   r5   r2   r   r   Úautocorrect_location_headerr3   r8   r4   r   r   r)   r   r   Š   s   
 r   )Ú
__future__r   ÚtypingÚtÚwerkzeug.exceptionsr   Úwerkzeug.wrappersr   ÚRequestBaser   ÚResponseBaseÚ r   Úglobalsr   Úhelpersr	   ÚTYPE_CHECKINGÚwerkzeug.routingr
   r   r   r   r   Ú<module>   s    y