6V=jddlmZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZdd l mZdd lmZejrdd lmZGd d eZdS)) annotationsN) timedelta)AppGroup) current_app)send_from_directory) Blueprint)BlueprintSetupState) _sentinel)ResponsecNeZdZdddddddefdfd Zd dZd!dZ d"d#dZxZS)$r Nnamestr import_name static_folderstr | os.PathLike[str] | Nonestatic_url_path str | Nonetemplate_folder url_prefix subdomain url_defaultsdict[str, t.Any] | None root_path cli_groupreturnNonec t||||||||| | t|_|j|j_dS)N)super__init__rclir) selfrrrrrrrrrr __class__s >C:\PYTHON\_runtimes\venv\Lib\site-packages\flask/blueprints.pyr zBlueprint.__init__s]            "::  filename int | Nonectjd}|dSt|tr!t |S|S)anUsed 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)rconfig isinstancerint total_seconds)r"r&values r$get_send_file_max_agezBlueprint.get_send_file_max_age7sM""#>? =4 eY ' ' .u**,,-- - r%r c|jstd||}tt jt |j||S)aAThe 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/rtcastrr)r"r&r1s r$send_static_filezBlueprint.send_static_fileRsa% USTT T,,X66" F3* + +Xw    r%rbutf-8resourcemodeencodingt.IO[t.AnyStr]c|dvrtdtj|j|}|dkrt ||St |||S)aeOpen 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. >rr7rtz)Resources can only be opened for reading.r7)r;) ValueErrorospathjoinropen)r"r9r:r;rBs r$ open_resourcezBlueprint.open_resourcehsd ( ( (HII Iw||DNH55 4<<d## #D$2222r%)rrrrrrrrrrrrrrrrrrrrrr)r&rrr')r&rrr )r7r8)r9rr:rr;rrr<) __name__ __module__ __qualname__r r r/r6rE __classcell__)r#s@r$r r s 8<&*9=!% $04 $ )""""""""""""""H6    .GN333333333r%r ) __future__rrAtypingr4datetimerr!rglobalsrhelpersrsansio.blueprintsr SansioBlueprintr sansio.scaffoldr TYPE_CHECKINGwrappersr r%r$rUs""""""  ((((((;;;;;;IIIIII&&&&&&?#""""""n3n3n3n3n3n3n3n3n3n3r%