
    p)fN                        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&                  rddlmZ  G d de      Zy)    )annotationsN)	timedelta   )AppGroup)current_app)send_from_directory)	Blueprint)BlueprintSetupState)	_sentinel)Responsec                  v     e Zd Zdddddddef	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZddZddZd	d
dZ xZS )r	   Nc                    t         |   |||||||||	|

       t               | _        | j                  | j                  _        y )N)super__init__r   cliname)selfr   import_namestatic_folderstatic_url_pathtemplate_folder
url_prefix	subdomainurl_defaults	root_path	cli_group	__class__s              M/var/www/html/flask-app/venv/lib/python3.12/site-packages/flask/blueprints.pyr   zBlueprint.__init__   sL     		
" : 		    c                    t         j                  d   }|yt        |t              rt	        |j                               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
        SEND_FILE_MAX_AGE_DEFAULTN)r   config
isinstancer   inttotal_seconds)r   filenamevalues      r   get_send_file_max_agezBlueprint.get_send_file_max_age7   s@    " ""#>?=eY'u**,--r   c                    | j                   st        d      | j                  |      }t        t	        j
                  t        | j                        ||      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)has_static_folderRuntimeErrorr(   r   tcaststrr   )r   r&   r*   s      r   send_static_filezBlueprint.send_static_fileR   sP     %%STT ,,X6"FF3**+Xw
 	
r   c                    |dvrt        d      t        t        j                  j	                  | j
                  |      |      S )a  Open a resource file relative to :attr:`root_path` for
        reading.

        For example, if the file ``schema.sql`` is next to the file
        ``app.py`` where the ``Flask`` app is defined, it can be opened
        with:

        .. code-block:: python

            with app.open_resource("schema.sql") as f:
                conn.executescript(f.read())

        :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".

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

        >   rrbrtz)Resources can only be opened for reading.)
ValueErroropenospathjoinr   )r   resourcemodes      r   open_resourcezBlueprint.open_resourceh   s9    , ((HIIBGGLL:DAAr   )r   r/   r   r/   r   str | os.PathLike[str] | Noner   
str | Noner   r=   r   r>   r   r>   r   zdict[str, t.Any] | Noner   r>   r   r>   returnNone)r&   r>   r?   z
int | None)r&   r/   r?   r   )r3   )r:   r/   r;   r/   r?   zt.IO[t.AnyStr])	__name__
__module____qualname__r   r   r(   r0   r<   __classcell__)r   s   @r   r	   r	      s    
 8<&*9=!% $04 $ )"""" "" 5	""
 $"" 7"" "" "" ."" "" "" 
""H6
,B Br   r	   )
__future__r   r7   typingr-   datetimer   r   r   globalsr   helpersr   sansio.blueprintsr	   SansioBlueprintr
   sansio.scaffoldr   TYPE_CHECKINGwrappersr    r   r   <module>rP      s=    " 	      ( ; I &??"oB oBr   