a
    0h                     @  s   d dl mZ d dl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 dd
lmZ ejrddlmZ G dd deZdS )    )annotationsN)	timedelta   )AppGroup)current_app)send_from_directory)	Blueprint)BlueprintSetupState)	_sentinel)Responsec                      s~   e Zd Zdddddddefdddddddddddd fdd	Zdd
dddZdddddZddddddddZ  ZS )r   Nstrzstr | os.PathLike[str] | Nonez
str | Nonezdict[str, t.Any] | NoneNone)nameimport_namestatic_folderstatic_url_pathtemplate_folder
url_prefix	subdomainurl_defaults	root_path	cli_groupreturnc                   s4   t  |||||||||	|

 t | _| j| j_d S )N)super__init__r   clir   )selfr   r   r   r   r   r   r   r   r   r   	__class__ >/var/www/auris/lib/python3.9/site-packages/flask/blueprints.pyr      s    zBlueprint.__init__z
int | None)filenamer   c                 C  s0   t jd }|du rdS t|tr,t| S |S )an  Used by :func:`send_file` to determine the ``max_age`` cache
        value for a given file path if it wasn't passed.

        By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from
        the configuration of :data:`~flask.current_app`. This defaults
        to ``None``, which tells the browser to use conditional requests
        instead of a timed cache, which is usually preferable.

        Note this is a duplicate of the same method in the Flask
        class.

        .. versionchanged:: 2.0
            The default configuration is ``None`` instead of 12 hours.

        .. versionadded:: 0.9
        ZSEND_FILE_MAX_AGE_DEFAULTN)r   config
isinstancer   inttotal_seconds)r   r!   valuer   r   r    get_send_file_max_age7   s    

zBlueprint.get_send_file_max_ager   c                 C  s0   | j std| |}ttt| j||dS )aA  The view function used to serve files from
        :attr:`static_folder`. A route is automatically registered for
        this view at :attr:`static_url_path` if :attr:`static_folder` is
        set.

        Note this is a duplicate of the same method in the Flask
        class.

        .. versionadded:: 0.5

        z2'static_folder' must be set to serve static_files.)max_age)Zhas_static_folderRuntimeErrorr'   r   tcastr   r   )r   r!   r(   r   r   r    send_static_fileR   s    
zBlueprint.send_static_filerbutf-8zt.IO[t.AnyStr])resourcemodeencodingr   c                 C  s@   |dvrt dtj| j|}|dkr2t||S t|||dS )ae  Open a resource file relative to :attr:`root_path` for reading. The
        blueprint-relative equivalent of the app's :meth:`~.Flask.open_resource`
        method.

        :param resource: Path to the resource relative to :attr:`root_path`.
        :param mode: Open the file in this mode. Only reading is supported,
            valid values are ``"r"`` (or ``"rt"``) and ``"rb"``.
        :param encoding: Open the file with this encoding when opening in text
            mode. This is ignored when opening in binary mode.

        .. versionchanged:: 3.1
            Added the ``encoding`` parameter.
        >   rrtr-   z)Resources can only be opened for reading.r-   )r1   )
ValueErrorospathjoinr   open)r   r/   r0   r1   r6   r   r   r    open_resourceh   s    
zBlueprint.open_resource)r-   r.   )	__name__
__module____qualname__r
   r   r'   r,   r9   __classcell__r   r   r   r    r      s   ($ r   )
__future__r   r5   typingr*   datetimer   r   r   globalsr   Zhelpersr   Zsansio.blueprintsr   ZSansioBlueprintr	   Zsansio.scaffoldr
   TYPE_CHECKINGwrappersr   r   r   r   r    <module>   s   