§
    ùÛgªE ã                   óº  — d 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mZmZmZ dd
lmZmZmZmZmZ ddlmZmZmZmZmZm Z m!Z! ddl"m#Z#m$Z$ ddl%m&Z&m'Z' ddl(m)Z)m*Z* ddl+m,Z,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7m8Z8m9Z9 ddl:m;Z;m<Z<m=Z=m>Z>m?Z? ddl@mAZAmBZBmCZCmDZD  e¦   «         ZE eF¦   «         ZGd„ ZHd„ ZI G d„ de¦  «        ZJdS )z¼
    flask.app
    ~~~~~~~~~

    This module implements the central WSGI application object.

    :copyright: (c) 2015 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
é    N)ÚLock)Ú	timedelta)Úchain©Úupdate_wrapper)Údeque)ÚImmutableDict)ÚMapÚRuleÚRequestRedirectÚ
BuildError)ÚHTTPExceptionÚInternalServerErrorÚMethodNotAllowedÚ
BadRequestÚdefault_exceptionsé   )Ú_PackageBoundObjectÚurl_forÚget_flashed_messagesÚlocked_cached_propertyÚ_endpoint_from_view_funcÚfind_packageÚget_debug_flag)ÚjsonÚcli)ÚRequestÚResponse)ÚConfigAttributeÚConfig)ÚRequestContextÚ
AppContextÚ_AppCtxGlobals)Ú_request_ctx_stackÚrequestÚsessionÚg)ÚSecureCookieSessionInterface)ÚDispatchingJinjaLoaderÚEnvironmentÚ_default_template_ctx_processor)Úrequest_startedÚrequest_finishedÚgot_request_exceptionÚrequest_tearing_downÚappcontext_tearing_down)ÚreraiseÚstring_typesÚ	text_typeÚinteger_typesc                 óP   — t          | t          ¦  «        st          | ¬¦  «        S | S )N)Úseconds)Ú
isinstancer   )Úvalues    ú?/granary/edev/quantum/lib/python3.11/site-packages/flask/app.pyÚ_make_timedeltar:   .   s*   € Ý�e�YÑ'Ô'ð (Ý Ð'Ñ'Ô'Ð'Ø€Ló    c                 ó.   ‡ — ˆ fd„}t          |‰ ¦  «        S )zkWraps a method so that it performs a check in debug mode if the
    first request was already handled.
    c                 óV   •— | j         r| j        rt          d¦  «        ‚ ‰| g|¢R i |¤ŽS )Nam  A setup function was called after the first request was handled.  This usually indicates a bug in the application where a module was not imported and decorators or other functionality was called too late.
To fix this make sure to import all your view modules, database models and everything related at a central place before the application starts serving requests.)ÚdebugÚ_got_first_requestÚAssertionError)ÚselfÚargsÚkwargsÚfs      €r9   Úwrapper_funcz!setupmethod.<locals>.wrapper_func8   sV   ø€ ØŒ:ð 	C˜$Ô1ð 	CÝ ð "Bñ Cô Cð Cð ˆq�Ð'˜Ð'Ð'Ð' Ð'Ð'Ð'r;   r   )rD   rE   s   ` r9   ÚsetupmethodrF   4   s.   ø€ ð	(ð 	(ð 	(ð 	(ð 	(õ ˜,¨Ñ*Ô*Ð*r;   c                   óØ  — e Zd ZdZeZeZeZ	e
Zd„ Zd„ Z eee¦  «        Z[[eZ ed¦  «        Z ed¦  «        Z ed¦  «        Z ed¦  «        Z ede¬	¦  «        Z ed
e¬	¦  «        Z ed¦  «        Z ed¦  «        Zej        Zej        Z  e!ddg¬¦  «        Z" e!i d e#d¬¦  «        “dd“dd“dd“dd“d e$d¬¦  «        “dd“dd“dd“dd“dd“dd“dd“dd“dd“d d“d!d“d e$d"¬#¦  «        dddd$dddd%dd&œ¥¦  «        Z%e&Z'dZ( e)¦   «         Z*	 	 	 	 dsd)„Z+d*„ Z,d+„ Z- ee,e-¦  «        Z.[,[-e/d,„ ¦   «         Z0ed-„ ¦   «         Z1ed.„ ¦   «         Z2ed/„ ¦   «         Z3e/d0„ ¦   «         Z4ed1„ ¦   «         Z5dtd2„Z6d3„ Z7dud5„Z8d6„ Z9d7„ Z:d8„ Z;d9„ Z<d:„ Z=d;„ Z>dvd<„Z?dwd=„Z@d>„ ZAd?„ ZBd@„ ZCeDdA„ ¦   «         ZEdB„ ZFeDdxdC„¦   «         ZGdD„ ZHeDdE„ ¦   «         ZIeJdF„ ¦   «         ZKeDdG„ ¦   «         ZLdH„ ZMeDdI„ ¦   «         ZNeDdydJ„¦   «         ZOeDdydK„¦   «         ZPeDdydL„¦   «         ZQeDdydM„¦   «         ZReDdydN„¦   «         ZSeDdydO„¦   «         ZTeDdP„ ¦   «         ZUeDdQ„ ¦   «         ZVeDdR„ ¦   «         ZWeDdS„ ¦   «         ZXeDdT„ ¦   «         ZYeDdU„ ¦   «         ZZeDdV„ ¦   «         Z[eDdW„ ¦   «         Z\eDdX„ ¦   «         Z]dY„ Z^dZ„ Z_d[„ Z`d\„ Zad]„ Zbd^„ Zcd_„ Zdd`„ Zeda„ Zfdb„ Zgdc„ Zhdd„ Zide„ Zjdf„ Zkdg„ Zldh„ Zmdi„ Zndj„ Zoepfdk„Zqepfdl„Zrdm„ Zsdn„ Ztdo„ Zudp„ Zvdq„ Zwdr„ ZxdS )zÚFlaska±  The flask object implements a WSGI application and acts as the central
    object.  It is passed the name of the module or package of the
    application.  Once it is created it will act as a central registry for
    the view functions, the URL rules, template configuration and much more.

    The name of the package is used to resolve resources from inside the
    package or the folder the module is contained in depending on if the
    package parameter resolves to an actual python package (a folder with
    an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).

    For more information about resource loading, see :func:`open_resource`.

    Usually you create a :class:`Flask` instance in your main module or
    in the :file:`__init__.py` file of your package like this::

        from flask import Flask
        app = Flask(__name__)

    .. admonition:: About the First Parameter

        The idea of the first parameter is to give Flask an idea of what
        belongs to your application.  This name is used to find resources
        on the filesystem, can be used by extensions to improve debugging
        information and a lot more.

        So it's important what you provide there.  If you are using a single
        module, `__name__` is always the correct value.  If you however are
        using a package, it's usually recommended to hardcode the name of
        your package there.

        For example if your application is defined in :file:`yourapplication/app.py`
        you should create it with one of the two versions below::

            app = Flask('yourapplication')
            app = Flask(__name__.split('.')[0])

        Why is that?  The application will work even with `__name__`, thanks
        to how resources are looked up.  However it will make debugging more
        painful.  Certain extensions can make assumptions based on the
        import name of your application.  For example the Flask-SQLAlchemy
        extension will look for the code in your application that triggered
        an SQL query in debug mode.  If the import name is not properly set
        up, that debugging information is lost.  (For example it would only
        pick up SQL queries in `yourapplication.app` and not
        `yourapplication.views.frontend`)

    .. versionadded:: 0.7
       The `static_url_path`, `static_folder`, and `template_folder`
       parameters were added.

    .. versionadded:: 0.8
       The `instance_path` and `instance_relative_config` parameters were
       added.

    .. versionadded:: 0.11
       The `root_path` parameter was added.

    :param import_name: the name of the application package
    :param static_url_path: can be used to specify a different path for the
                            static files on the web.  Defaults to the name
                            of the `static_folder` folder.
    :param static_folder: the folder with static files that should be served
                          at `static_url_path`.  Defaults to the ``'static'``
                          folder in the root path of the application.
    :param template_folder: the folder that contains the templates that should
                            be used by the application.  Defaults to
                            ``'templates'`` folder in the root path of the
                            application.
    :param instance_path: An alternative instance path for the application.
                          By default the folder ``'instance'`` next to the
                          package or module is assumed to be the instance
                          path.
    :param instance_relative_config: if set to ``True`` relative filenames
                                     for loading the config are assumed to
                                     be relative to the instance path instead
                                     of the application root.
    :param root_path: Flask by default will automatically calculate the path
                      to the root of the application.  In certain situations
                      this cannot be achieved (for instance if the package
                      is a Python 3 namespace package) and needs to be
                      manually defined.
    c                 ó   — | j         S ©N)Úapp_ctx_globals_class©rA   s    r9   Ú_get_request_globals_classz Flask._get_request_globals_class·   s   € ØÔ)Ð)r;   c                 óP   — ddl m}  |t          d¦  «        ¦  «         || _        d S )Nr   ©ÚwarnzCrequest_globals_class attribute is now called app_ctx_globals_class)ÚwarningsrP   ÚDeprecationWarningrK   )rA   r8   rP   s      r9   Ú_set_request_globals_classz Flask._set_request_globals_class¹   sM   € Ø!Ð!Ð!Ð!Ð!Ð!ØˆÕð !?ñ @ô @ñ 	Aô 	Að 	Aà%*ˆÔ"Ð"Ð"r;   ÚDEBUGÚTESTINGÚ
SECRET_KEYÚSESSION_COOKIE_NAMEÚPERMANENT_SESSION_LIFETIME)Úget_converterÚSEND_FILE_MAX_AGE_DEFAULTÚUSE_X_SENDFILEÚLOGGER_NAMEzjinja2.ext.autoescapezjinja2.ext.with_)Ú
extensionsF)ÚdefaultÚPROPAGATE_EXCEPTIONSNÚPRESERVE_CONTEXT_ON_EXCEPTIONé   )ÚdaysÚLOGGER_HANDLER_POLICYÚalwaysÚSERVER_NAMEÚAPPLICATION_ROOTr&   ÚSESSION_COOKIE_DOMAINÚSESSION_COOKIE_PATHÚSESSION_COOKIE_HTTPONLYTÚSESSION_COOKIE_SECUREÚSESSION_REFRESH_EACH_REQUESTé   )ÚhoursÚhttpzapplication/json)ÚMAX_CONTENT_LENGTHrZ   ÚTRAP_BAD_REQUEST_ERRORSÚTRAP_HTTP_EXCEPTIONSÚEXPLAIN_TEMPLATE_LOADINGÚPREFERRED_URL_SCHEMEÚJSON_AS_ASCIIÚJSON_SORT_KEYSÚJSONIFY_PRETTYPRINT_REGULARÚJSONIFY_MIMETYPEÚTEMPLATES_AUTO_RELOADÚstaticÚ	templatesc	                 ó€  — t          j        | |||¬¦  «         |�"ddlm}	  |	t	          d¦  «        d¬¦  «         |}|�|| _        |�|| _        |€|                      ¦   «         }n.t          j	         
                    |¦  «        st          d¦  «        ‚|| _        |                      |¦  «        | _        d | _        | j        | _        i | _        i | _        d | j        i| _        g | _        i | _        g | _        i | _        i | _        g | _        i | _        i | _        d t:          gi| _        g | _        i | _         g | _!        i | _"        tG          ¦   «         | _$        d| _%        tM          ¦   «         | _'        | j(        r%|  )                    | j        d	z   d
| j*        ¬¦  «         tW          j,        | j-        ¦  «        | _+        d S )N)Útemplate_folderÚ	root_pathr   rO   z)static_path is now called static_url_pathé   ©Ú
stacklevelzXIf an instance path is provided it must be absolute.  A relative path was given instead.Fz/<path:filename>ry   )ÚendpointÚ	view_func).r   Ú__init__rQ   rP   rR   Ústatic_url_pathÚstatic_folderÚauto_find_instance_pathÚosÚpathÚisabsÚ
ValueErrorÚinstance_pathÚmake_configÚconfigÚ_loggerÚimport_nameÚlogger_nameÚview_functionsÚ_error_handlersÚerror_handler_specÚurl_build_error_handlersÚbefore_request_funcsÚbefore_first_request_funcsÚafter_request_funcsÚteardown_request_funcsÚteardown_appcontext_funcsÚurl_value_preprocessorsÚurl_default_functionsr+   Útemplate_context_processorsÚshell_context_processorsÚ
blueprintsÚ_blueprint_orderr]   r
   Úurl_mapr?   r   Ú_before_request_lockÚhas_static_folderÚadd_url_ruleÚsend_static_filer   ÚAppGroupÚname)
rA   r�   Ústatic_pathr„   r…   r|   r‹   Úinstance_relative_configr}   rP   s
             r9   rƒ   zFlask.__init__T  s?  € õ 	Ô$ T¨;Ø5DØ/8ð	:ñ 	:ô 	:ð 	:ð Ð"Ø%Ð%Ð%Ð%Ð%Ð%ØˆDÕ#ð %6ñ 7ô 7ØCDðFñ Fô Fð Fà)ˆOàÐ&Ø#2ˆDÔ ØÐ$Ø!.ˆDÔØÐ Ø ×8Ò8Ñ:Ô:ˆMˆMÝ”—’˜}Ñ-Ô-ð 	NÝð Mñ Nô Nð Nð +ˆÔð
 ×&Ò&Ð'?Ñ@Ô@ˆŒð ˆŒØÔ+ˆÔð !ˆÔð  "ˆÔð $(¨Ô)=Ð">ˆÔð )+ˆÔ%ð %'ˆÔ!ð +-ˆÔ'ð $&ˆÔ ð ')ˆÔ#ð *,ˆÔ&ð (*ˆÔ$ð &(ˆÔ"ð Õ2Ð3ð,
ˆÔ(ð )+ˆÔ%ð ˆŒØ "ˆÔð  ˆŒõ" ‘u”uˆŒð #(ˆÔÝ$(¡F¤FˆÔ!ð Ô!ð 	?Ø×Ò˜dÔ2Ð5GÑGØ'/Ø(,Ô(=ð ñ ?ô ?ð ?õ ”< ¤	Ñ*Ô*ˆŒˆˆr;   c                 óP   — ddl m}  |t          d¦  «        d¬¦  «         | j        S )Nr   rO   zOerror_handlers is deprecated, use the new error_handler_spec attribute instead.r   r   )rQ   rP   rR   r’   )rA   rP   s     r9   Ú_get_error_handlerszFlask._get_error_handlers(  sO   € Ø!Ð!Ð!Ð!Ð!Ð!ØˆÕð !8ñ 9ô 9ØEFð	Hñ 	Hô 	Hð 	HàÔ#Ð#r;   c                 ó(   — || _         || j        d <   d S rJ   )r’   r“   )rA   r8   s     r9   Ú_set_error_handlerszFlask._set_error_handlers-  s   € Ø$ˆÔØ(-ˆÔ Ñ%Ð%Ð%r;   c                 óô   — | j         dk    rgt          t          j        d         dd¦  «        }|€dS t          j                             t          j                             |¦  «        ¦  «        d         S | j         S )a_  The name of the application.  This is usually the import name
        with the difference that it's guessed from the run file if the
        import name is main.  This name is used as a display name when
        Flask needs the name of the application.  It can be set and overridden
        to change the value.

        .. versionadded:: 0.8
        Ú__main__Ú__file__Nr   )r�   ÚgetattrÚsysÚmodulesr‡   rˆ   ÚsplitextÚbasename)rA   Úfns     r9   r¦   z
Flask.name3  sh   € ð Ô˜zÒ)Ð)Ý�œ ZÔ0°*¸dÑCÔCˆBØˆzØ!�zÝ”7×#Ò#¥B¤G×$4Ò$4°RÑ$8Ô$8Ñ9Ô9¸!Ô<Ð<ØÔÐr;   c                 ó@   — | j         d         }|�|S | j        p| j        S )z±Returns the value of the ``PROPAGATE_EXCEPTIONS`` configuration
        value in case it's set, otherwise a sensible default is returned.

        .. versionadded:: 0.7
        r_   )r�   Útestingr>   ©rA   Úrvs     r9   Úpropagate_exceptionszFlask.propagate_exceptionsD  s*   € ð Œ[Ð/Ô0ˆØˆ>ØˆIØŒ|Ð)˜tœzÐ)r;   c                 ó2   — | j         d         }|�|S | j        S )zÂReturns the value of the ``PRESERVE_CONTEXT_ON_EXCEPTION``
        configuration value in case it's set, otherwise a sensible default
        is returned.

        .. versionadded:: 0.7
        r`   )r�   r>   r¸   s     r9   Úpreserve_context_on_exceptionz#Flask.preserve_context_on_exceptionP  s#   € ð Œ[Ð8Ô9ˆØˆ>ØˆIØŒzÐr;   c                 ó  — | j         r| j         j        | j        k    r| j         S t          5  | j         r(| j         j        | j        k    r| j         cddd¦  «         S ddlm}  || ¦  «        x| _         }|cddd¦  «         S # 1 swxY w Y   dS )aÂ  A :class:`logging.Logger` object for this application.  The
        default configuration is to log to stderr if the application is
        in debug mode.  This logger can be used to (surprise) log messages.
        Here some examples::

            app.logger.debug('A value for debugging')
            app.logger.warning('A warning occurred (%d apples)', 42)
            app.logger.error('An error occurred')

        .. versionadded:: 0.3
        Nr   )Úcreate_logger)rŽ   r¦   r�   Ú_logger_lockÚflask.loggingr¾   )rA   r¾   r¹   s      r9   ÚloggerzFlask.logger]  s  € ð Œ<ð 	 ˜DœLÔ-°Ô1AÒAÐAØ”<ÐÝð 	ð 	ØŒ|ð $ ¤Ô 1°TÔ5EÒ EÐ EØ”|ð	ð 	ð 	ð 	ñ 	ô 	ð 	ð 	ð 4Ð3Ð3Ð3Ð3Ð3Ø - ¨dÑ 3Ô 3Ð3ˆDŒL˜2Øð	ð 	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð 	ð 	s   «#BÁBÂBÂBc                 ó*   — |                       ¦   «         S )z.The Jinja2 environment used to load templates.)Úcreate_jinja_environmentrL   s    r9   Ú	jinja_envzFlask.jinja_envs  s   € ð ×,Ò,Ñ.Ô.Ð.r;   c                 ó   — | j         S )zˆThis attribute is set to ``True`` if the application started
        handling the first request.

        .. versionadded:: 0.8
        )r?   rL   s    r9   Úgot_first_requestzFlask.got_first_requestx  s   € ð Ô&Ð&r;   c                 óX   — | j         }|r| j        }|                      || j        ¦  «        S )ad  Used to create the config attribute by the Flask constructor.
        The `instance_relative` parameter is passed in from the constructor
        of Flask (there named `instance_relative_config`) and indicates if
        the config should be relative to the instance path or the root path
        of the application.

        .. versionadded:: 0.8
        )r}   r‹   Úconfig_classÚdefault_config)rA   Úinstance_relativer}   s      r9   rŒ   zFlask.make_config�  s4   € ð ”Nˆ	Øð 	+ØÔ*ˆIØ× Ò  ¨DÔ,?Ñ@Ô@Ð@r;   c                 óÆ   — t          | j        ¦  «        \  }}|€ t          j                             |d¦  «        S t          j                             |d| j        dz   ¦  «        S )a  Tries to locate the instance path if it was not provided to the
        constructor of the application class.  It will basically calculate
        the path to a folder named ``instance`` next to your main file or
        the package.

        .. versionadded:: 0.8
        NÚinstanceÚvarz	-instance)r   r�   r‡   rˆ   Újoinr¦   )rA   ÚprefixÚpackage_paths      r9   r†   zFlask.auto_find_instance_path�  sS   € õ  ,¨DÔ,<Ñ=Ô=Ñˆ�Øˆ>Ý”7—<’< ¨jÑ9Ô9Ð9ÝŒw�|Š|˜F E¨4¬9°{Ñ+BÑCÔCÐCr;   Úrbc                 óh   — t          t          j                             | j        |¦  «        |¦  «        S )aª  Opens a resource from the application's instance folder
        (:attr:`instance_path`).  Otherwise works like
        :meth:`open_resource`.  Instance resources can also be opened for
        writing.

        :param resource: the name of the resource.  To access resources within
                         subfolders use forward slashes as separator.
        :param mode: resource file opening mode, default is 'rb'.
        )Úopenr‡   rˆ   rÎ   r‹   )rA   ÚresourceÚmodes      r9   Úopen_instance_resourcezFlask.open_instance_resourceœ  s'   € õ •B”G—L’L Ô!3°XÑ>Ô>ÀÑEÔEÐEr;   c                 ób  — t          | j        ¦  «        }d|vr
| j        |d<   d|vr(| j        d         �| j        d         |d<   n
| j        |d<    | j        | fi |¤Ž}|j                             t          t          | j        t          t          t          ¬¦  «         t          j        |j        d<   |S )a¾  Creates the Jinja2 environment based on :attr:`jinja_options`
        and :meth:`select_jinja_autoescape`.  Since 0.7 this also adds
        the Jinja2 globals and filters after initialization.  Override
        this function to customize the behavior.

        .. versionadded:: 0.5
        .. versionchanged:: 0.11
           ``Environment.auto_reload`` set in accordance with
           ``TEMPLATES_AUTO_RELOAD`` configuration option.
        Ú
autoescapeÚauto_reloadrx   N)r   r   r�   r%   r&   r'   Útojson)ÚdictÚjinja_optionsÚselect_jinja_autoescaper�   r>   Újinja_environmentÚglobalsÚupdater   r   r%   r&   r'   r   Útojson_filterÚfilters)rA   Úoptionsr¹   s      r9   rÃ   zFlask.create_jinja_environment¨  sË   € õ �tÔ)Ñ*Ô*ˆØ˜wÐ&Ð&Ø$(Ô$@ˆG�LÑ!Ø Ð'Ð'ØŒ{Ð2Ô3Ð?Ø)-¬Ð5LÔ)M�˜Ñ&Ð&à)-¬�˜Ñ&Ø#ˆTÔ# DÐ4Ð4¨GÐ4Ð4ˆØ
Œ
×ÒÝÝ!5Ø”;õ ÝÝð 	ñ 
	
ô 
	
ð 
	
õ  $Ô1ˆŒ
�8ÑØˆ	r;   c                 ó    — t          | ¦  «        S )a   Creates the loader for the Jinja2 environment.  Can be used to
        override just the loader and keeping the rest unchanged.  It's
        discouraged to override this function.  Instead one should override
        the :meth:`jinja_loader` function instead.

        The global loader dispatches between the loaders of the application
        and the individual blueprints.

        .. versionadded:: 0.7
        )r)   rL   s    r9   Úcreate_global_jinja_loaderz Flask.create_global_jinja_loaderÊ  s   € õ & dÑ+Ô+Ð+r;   c                 ó   — dS )zéDeprecated.  Used to initialize the Jinja2 globals.

        .. versionadded:: 0.5
        .. versionchanged:: 0.7
           This method is deprecated with 0.7.  Override
           :meth:`create_jinja_environment` instead.
        N© rL   s    r9   Úinit_jinja_globalszFlask.init_jinja_globals×  s   € € € r;   c                 ó4   — |€dS |                      d¦  «        S )z¬Returns ``True`` if autoescaping should be active for the given
        template name. If no template name is given, returns `True`.

        .. versionadded:: 0.5
        NT)z.htmlz.htmz.xmlz.xhtml)Úendswith)rA   Úfilenames     r9   rÝ   zFlask.select_jinja_autoescapeà  s$   € ð ÐØ�4Ø× Ò Ð!DÑEÔEÐEr;   c                 ó6  — | j         d         }t          j        }|�2|j        j        }|�$|| j         v rt          || j         |         ¦  «        }|                     ¦   «         }|D ]}|                      |¦   «         ¦  «         Œ |                     |¦  «         dS )a  Update the template context with some commonly used variables.
        This injects request, session, config and g into the template
        context as well as everything template context processors want
        to inject.  Note that the as of Flask 0.6, the original values
        in the context will not be overridden if a context processor
        decides to return a value with the same key.

        :param context: the context as a dictionary that is updated in place
                        to add extra variables.
        N)rœ   r$   Útopr%   Ú	blueprintr   Úcopyrà   )rA   ÚcontextÚfuncsÚreqctxÚbpÚorig_ctxÚfuncs          r9   Úupdate_template_contextzFlask.update_template_contextê  s£   € ð Ô0°Ô6ˆÝ#Ô'ˆØÐØ”Ô)ˆBØˆ~ "¨Ô(HÐ"HÐ"HÝ˜e TÔ%EÀbÔ%IÑJÔJ�Ø—<’<‘>”>ˆØð 	#ð 	#ˆDØ�NŠN˜4˜4™6œ6Ñ"Ô"Ð"Ð"ð 	�Š�xÑ Ô Ð Ð Ð r;   c                 óh   — | t           dœ}| j        D ]}|                      |¦   «         ¦  «         Œ |S )z¹Returns the shell context for an interactive shell for this
        application.  This runs all the registered shell context
        processors.

        .. versionadded:: 0.11
        )Úappr'   )r'   r�   rà   )rA   r¹   Ú	processors      r9   Úmake_shell_contextzFlask.make_shell_context  sC   € ð ¥Ð"Ð"ˆØÔ6ð 	#ð 	#ˆIØ�IŠI�i�i‘k”kÑ"Ô"Ð"Ð"Øˆ	r;   c                 óž  — ddl m} |€d}|€?| j        d         }|r.d|v r*t          |                     dd¦  «        d         ¦  «        }nd}|�t          |¦  «        | _        |                     d	| j        ¦  «         |                     d
| j        ¦  «         |                     dd¦  «         	  |||| fi |¤Ž d| _        dS # d| _        w xY w)aÆ  Runs the application on a local development server.

        Do not use ``run()`` in a production setting. It is not intended to
        meet security and performance requirements for a production server.
        Instead, see :ref:`deployment` for WSGI server recommendations.

        If the :attr:`debug` flag is set the server will automatically reload
        for code changes and show a debugger in case an exception happened.

        If you want to run the application in debug mode, but disable the
        code execution on the interactive debugger, you can pass
        ``use_evalex=False`` as parameter.  This will keep the debugger's
        traceback screen active, but disable code execution.

        It is not recommended to use this function for development with
        automatic reloading as this is badly supported.  Instead you should
        be using the :command:`flask` command line script's ``run`` support.

        .. admonition:: Keep in Mind

           Flask will suppress any server error with a generic error page
           unless it is in debug mode.  As such to enable just the
           interactive debugger without the code reloading, you have to
           invoke :meth:`run` with ``debug=True`` and ``use_reloader=False``.
           Setting ``use_debugger`` to ``True`` without being in debug mode
           won't catch any exceptions because there won't be any to
           catch.

        .. versionchanged:: 0.10
           The default port is now picked from the ``SERVER_NAME`` variable.

        :param host: the hostname to listen on. Set this to ``'0.0.0.0'`` to
                     have the server available externally as well. Defaults to
                     ``'127.0.0.1'``.
        :param port: the port of the webserver. Defaults to ``5000`` or the
                     port defined in the ``SERVER_NAME`` config variable if
                     present.
        :param debug: if given, enable or disable debug mode.
                      See :attr:`debug`.
        :param options: the options to be forwarded to the underlying
                        Werkzeug server.  See
                        :func:`werkzeug.serving.run_simple` for more
                        information.
        r   )Ú
run_simpleNz	127.0.0.1re   ú:r   iˆ  Úuse_reloaderÚuse_debuggerÚpassthrough_errorsTF)	Úwerkzeug.servingrü   r�   ÚintÚrsplitÚboolr>   Ú
setdefaultr?   )rA   ÚhostÚportr>   rã   rü   Úserver_names          r9   Úrunz	Flask.run  s  € ðZ 	0Ð/Ð/Ð/Ð/Ð/Øˆ<ØˆDØˆ<Øœ+ mÔ4ˆKØð ˜s kÐ1Ð1Ý˜;×-Ò-¨c°1Ñ5Ô5°aÔ8Ñ9Ô9��à�ØÐÝ˜e™œˆDŒJØ×Ò˜>¨4¬:Ñ6Ô6Ð6Ø×Ò˜>¨4¬:Ñ6Ô6Ð6Ø×ÒÐ/°Ñ6Ô6Ð6ð	,ØˆJ�t˜T 4Ð3Ð3¨7Ð3Ð3Ð3ð
 ',ˆDÔ#Ð#Ð#ø eˆDÔ#Ð+Ð+Ð+Ð+s   Â/C Ã	Cc                 óB   — | j         }|€ddlm}  || | j        fd|i|¤ŽS )aŒ  Creates a test client for this application.  For information
        about unit testing head over to :ref:`testing`.

        Note that if you are testing for assertions or exceptions in your
        application code, you must set ``app.testing = True`` in order for the
        exceptions to propagate to the test client.  Otherwise, the exception
        will be handled by the application (not visible to the test client) and
        the only indication of an AssertionError or other exception will be a
        500 status code response to the test client.  See the :attr:`testing`
        attribute.  For example::

            app.testing = True
            client = app.test_client()

        The test client can be used in a ``with`` block to defer the closing down
        of the context until the end of the ``with`` block.  This is useful if
        you want to access the context locals for testing::

            with app.test_client() as c:
                rv = c.get('/?vodka=42')
                assert request.args['vodka'] == '42'

        Additionally, you may pass optional keyword arguments that will then
        be passed to the application's :attr:`test_client_class` constructor.
        For example::

            from flask.testing import FlaskClient

            class CustomClient(FlaskClient):
                def __init__(self, authentication=None, *args, **kwargs):
                    FlaskClient.__init__(*args, **kwargs)
                    self._authentication = authentication

            app.test_client_class = CustomClient
            client = app.test_client(authentication='Basic ....')

        See :class:`~flask.testing.FlaskClient` for more information.

        .. versionchanged:: 0.4
           added support for ``with`` block usage for the client.

        .. versionadded:: 0.7
           The `use_cookies` parameter was added as well as the ability
           to override the client to be used by setting the
           :attr:`test_client_class` attribute.

        .. versionchanged:: 0.11
           Added `**kwargs` to support passing additional keyword arguments to
           the constructor of :attr:`test_client_class`.
        Nr   )ÚFlaskClientÚuse_cookies)Útest_client_classÚflask.testingr  Úresponse_class)rA   r  rC   Úclss       r9   Útest_clientzFlask.test_clientR  sF   € ðf Ô$ˆØˆ;Ø8Ð8Ð8Ð8Ð8Ð8Øˆs�4˜Ô,ÐPÐP¸+ÐPÈÐPÐPÐPr;   c                 ó8   — | j                              | |¦  «        S )aP  Creates or opens a new session.  Default implementation stores all
        session data in a signed cookie.  This requires that the
        :attr:`secret_key` is set.  Instead of overriding this method
        we recommend replacing the :class:`session_interface`.

        :param request: an instance of :attr:`request_class`.
        )Úsession_interfaceÚopen_session©rA   r%   s     r9   r  zFlask.open_sessionŠ  s   € ð Ô%×2Ò2°4¸ÑAÔAÐAr;   c                 ó:   — | j                              | ||¦  «        S )a¶  Saves the session if it needs updates.  For the default
        implementation, check :meth:`open_session`.  Instead of overriding this
        method we recommend replacing the :class:`session_interface`.

        :param session: the session to be saved (a
                        :class:`~werkzeug.contrib.securecookie.SecureCookie`
                        object)
        :param response: an instance of :attr:`response_class`
        )r  Úsave_session)rA   r&   Úresponses      r9   r  zFlask.save_session”  s   € ð Ô%×2Ò2°4¸À(ÑKÔKÐKr;   c                 ó6   — | j                              | ¦  «        S )z¶Creates a new instance of a missing session.  Instead of overriding
        this method we recommend replacing the :class:`session_interface`.

        .. versionadded:: 0.7
        )r  Úmake_null_sessionrL   s    r9   r  zFlask.make_null_session   s   € ð Ô%×7Ò7¸Ñ=Ô=Ð=r;   c                 ó&  — d}|j         | j        v r>| j        |j                  |u s)J d|›d| j        |j                  ›d|j         ›d�¦   «         ‚n+|| j        |j         <   | j                             |¦  «         d}|                     | ||¦  «         dS )aá  Register a blueprint on the application. For information about 
        blueprints head over to :ref:`blueprints`.

        The blueprint name is passed in as the first argument.	
        Options are passed as additional keyword arguments and forwarded to 
        `blueprints` in an "options" dictionary.

        :param subdomain: set a subdomain for the blueprint
        :param url_prefix: set the prefix for all URLs defined on the blueprint.
                            ``(url_prefix='/<lang code>')``
        :param url_defaults: a dictionary with URL defaults that is added to 
                            each and every URL defined with this blueprint
        :param static_folder: add a static folder to urls in this blueprint
        :param static_url_path: add a static url path to urls in this blueprint
        :param template_folder: set an alternate template folder
        :param root_path: set an alternate root path for this blueprint

        .. versionadded:: 0.7
        Fz.A blueprint's name collision occurred between z and z.  Both share the same name "z=".  Blueprints that are created on the fly need unique names.TN)r¦   rž   rŸ   ÚappendÚregister)rA   rî   rã   Úfirst_registrations       r9   Úregister_blueprintzFlask.register_blueprint¨  s¶   € ð* #ÐØŒ>˜Tœ_Ð,Ð,Ø”? 9¤>Ô2°iÐ?Ð?Ð?Ð?ð ��˜DœO¨I¬NÔ;Ð;Ð;¸Y¼^¸^¸^ðMñ @Ô?Ð?Ð?ð /8ˆDŒO˜IœNÑ+ØÔ!×(Ò(¨Ñ3Ô3Ð3Ø!%ÐØ×Ò˜4 Ð*<Ñ=Ô=Ð=Ð=Ð=r;   c                 ó*   — t          | j        ¦  «        S )zhIterates over all blueprints by the order they were registered.

        .. versionadded:: 0.11
        )ÚiterrŸ   rL   s    r9   Úiter_blueprintszFlask.iter_blueprintsÊ  s   € õ
 �DÔ)Ñ*Ô*Ð*r;   c                 ó�  — |€t          |¦  «        }||d<   |                     dd¦  «        }|€t          |dd¦  «        pd}t          |t          ¦  «        rt          d¦  «        ‚t          d„ |D ¦   «         ¦  «        }t          t          |dd¦  «        ¦  «        }t          |d	d¦  «        }|€d
|vrd}|                     d
¦  «         nd}||z  } | j        |fd|i|¤Ž}||_	        | j
                             |¦  «         |�@| j                             |¦  «        }|�||k    rt          d|z  ¦  «        ‚|| j        |<   dS dS )aƒ  Connects a URL rule.  Works exactly like the :meth:`route`
        decorator.  If a view_func is provided it will be registered with the
        endpoint.

        Basically this example::

            @app.route('/')
            def index():
                pass

        Is equivalent to the following::

            def index():
                pass
            app.add_url_rule('/', 'index', index)

        If the view_func is not provided you will need to connect the endpoint
        to a view function like so::

            app.view_functions['index'] = index

        Internally :meth:`route` invokes :meth:`add_url_rule` so if you want
        to customize the behavior via subclassing you only need to change
        this method.

        For more information refer to :ref:`url-route-registrations`.

        .. versionchanged:: 0.2
           `view_func` parameter added.

        .. versionchanged:: 0.6
           ``OPTIONS`` is added automatically as method.

        :param rule: the URL rule as string
        :param endpoint: the endpoint for the registered URL rule.  Flask
                         itself assumes the name of the view function as
                         endpoint
        :param view_func: the function to call when serving a request to the
                          provided endpoint
        :param options: the options to be forwarded to the underlying
                        :class:`~werkzeug.routing.Rule` object.  A change
                        to Werkzeug is handling of method options.  methods
                        is a list of methods this rule should be limited
                        to (``GET``, ``POST`` etc.).  By default a rule
                        just listens for ``GET`` (and implicitly ``HEAD``).
                        Starting with Flask 0.6, ``OPTIONS`` is implicitly
                        added and handled by the standard request handling.
        Nr�   Úmethods)ÚGETz_Allowed methods have to be iterables of strings, for example: @app.route(..., methods=["POST"])c              3   ó>   K  — | ]}|                      ¦   «         V — Œd S rJ   )Úupper)Ú.0Úitems     r9   ú	<genexpr>z%Flask.add_url_rule.<locals>.<genexpr>  s*   è è € Ð7Ð7 t�d—j’j‘l”lÐ7Ð7Ð7Ð7Ð7Ð7r;   Úrequired_methodsrç   Úprovide_automatic_optionsÚOPTIONSTFzFView function mapping is overwriting an existing endpoint function: %s)r   Úpopr°   r7   r2   Ú	TypeErrorÚsetÚaddÚurl_rule_classr,  r    r‘   Úgetr@   )	rA   Úruler�   r‚   rã   r$  r+  r,  Úold_funcs	            r9   r£   zFlask.add_url_ruleÑ  s½  € ðd ÐÝ/°	Ñ:Ô:ˆHØ&ˆ�
ÑØ—+’+˜i¨Ñ.Ô.ˆð
 ˆ?Ý˜i¨°DÑ9Ô9ÐE¸XˆGÝ�g�|Ñ,Ô,ð 	NÝð Mñ Nô Nð NåÐ7Ð7¨wÐ7Ñ7Ô7Ñ7Ô7ˆõ �w yÐ2DÀbÑIÔIÑJÔJÐõ %,¨IØ'¨ñ%/ô %/Ð!ð %Ð,Ø Ð'Ð'Ø,0Ð)Ø ×$Ò$ YÑ/Ô/Ð/Ð/à,1Ð)ð 	Ð#Ñ#ˆà"ˆtÔ" 4ÐDÐD°ÐD¸GÐDÐDˆØ)BˆÔ&àŒ×Ò˜ÑÔÐØÐ ØÔ*×.Ò.¨xÑ8Ô8ˆHØÐ#¨°IÒ(=Ð(=Ý$ð &FØHPñ&Qñ Rô Rð Rà,5ˆDÔ Ñ)Ð)Ð)ð !Ð r;   c                 ó   ‡ ‡‡— ˆˆˆ fd„}|S )a�  A decorator that is used to register a view function for a
        given URL rule.  This does the same thing as :meth:`add_url_rule`
        but is intended for decorator usage::

            @app.route('/')
            def index():
                return 'Hello World'

        For more information refer to :ref:`url-route-registrations`.

        :param rule: the URL rule as string
        :param endpoint: the endpoint for the registered URL rule.  Flask
                         itself assumes the name of the view function as
                         endpoint
        :param options: the options to be forwarded to the underlying
                        :class:`~werkzeug.routing.Rule` object.  A change
                        to Werkzeug is handling of method options.  methods
                        is a list of methods this rule should be limited
                        to (``GET``, ``POST`` etc.).  By default a rule
                        just listens for ``GET`` (and implicitly ``HEAD``).
                        Starting with Flask 0.6, ``OPTIONS`` is implicitly
                        added and handled by the standard request handling.
        c                 óT   •— ‰                      dd ¦  «        } ‰j        ‰|| fi ‰¤Ž | S )Nr�   )r.  r£   )rD   r�   rã   r4  rA   s     €€€r9   Ú	decoratorzFlask.route.<locals>.decoratorG  s:   ø€ Ø—{’{ :¨tÑ4Ô4ˆHØˆDÔ˜d H¨aÐ;Ð;°7Ð;Ð;Ð;ØˆHr;   rç   )rA   r4  rã   r8  s   ``` r9   ÚroutezFlask.route/  s0   øøø€ ð0	ð 	ð 	ð 	ð 	ð 	ð 	ð Ðr;   c                 ó   ‡ ‡— ˆˆ fd„}|S )zëA decorator to register a function as an endpoint.
        Example::

            @app.endpoint('example.endpoint')
            def example():
                return "example"

        :param endpoint: the name of the endpoint
        c                 ó   •— | ‰j         ‰<   | S rJ   )r‘   )rD   r�   rA   s    €€r9   r8  z!Flask.endpoint.<locals>.decoratorX  s   ø€ Ø,-ˆDÔ Ñ)ØˆHr;   rç   )rA   r�   r8  s   `` r9   r�   zFlask.endpointM  s*   øø€ ð	ð 	ð 	ð 	ð 	ð 	ð Ðr;   c                 ó¾   — t          | t          ¦  «        rt          |          }n| }t          |t          ¦  «        sJ ‚t          |t
          ¦  «        r	||j        fS |dfS )z7Ensure that we register only exceptions as handler keysN)r7   r4   r   Ú
issubclassÚ	Exceptionr   Úcode)Úexc_class_or_codeÚ	exc_classs     r9   Ú_get_exc_class_and_codezFlask._get_exc_class_and_code]  sh   € õ Ð'­Ñ7Ô7ð 	*Ý*Ð+<Ô=ˆIˆIà)ˆIå˜)¥YÑ/Ô/Ð/Ð/Ð/å�i¥Ñ/Ô/ð 	#Ø˜iœnÐ,Ð,à˜d�?Ð"r;   c                 ó   ‡ ‡— ˆˆ fd„}|S )aa  A decorator that is used to register a function give a given
        error code.  Example::

            @app.errorhandler(404)
            def page_not_found(error):
                return 'This page does not exist', 404

        You can also register handlers for arbitrary exceptions::

            @app.errorhandler(DatabaseError)
            def special_exception_handler(error):
                return 'Database connection failed', 500

        You can also register a function as error handler without using
        the :meth:`errorhandler` decorator.  The following example is
        equivalent to the one above::

            def page_not_found(error):
                return 'This page does not exist', 404
            app.error_handler_spec[None][404] = page_not_found

        Setting error handlers via assignments to :attr:`error_handler_spec`
        however is discouraged as it requires fiddling with nested dictionaries
        and the special case for arbitrary exception types.

        The first ``None`` refers to the active blueprint.  If the error
        handler should be application wide ``None`` shall be used.

        .. versionadded:: 0.7
            Use :meth:`register_error_handler` instead of modifying
            :attr:`error_handler_spec` directly, for application wide error
            handlers.

        .. versionadded:: 0.7
           One can now additionally also register custom exception types
           that do not necessarily have to be a subclass of the
           :class:`~werkzeug.exceptions.HTTPException` class.

        :param code: the code as integer for the handler
        c                 ó6   •— ‰                      d ‰| ¦  «         | S rJ   ©Ú_register_error_handler)rD   Úcode_or_exceptionrA   s    €€r9   r8  z%Flask.errorhandler.<locals>.decorator–  s!   ø€ Ø×(Ò(¨Ð/@À!ÑDÔDÐDØˆHr;   rç   )rA   rG  r8  s   `` r9   ÚerrorhandlerzFlask.errorhandlerl  s+   øø€ ðT	ð 	ð 	ð 	ð 	ð 	ð Ðr;   c                 ó4   — |                       d||¦  «         dS )z¼Alternative error attach function to the :meth:`errorhandler`
        decorator that is more straightforward to use for non decorator
        usage.

        .. versionadded:: 0.7
        NrE  )rA   rG  rD   s      r9   Úregister_error_handlerzFlask.register_error_handler›  s#   € ð 	×$Ò$ TÐ+<¸aÑ@Ô@Ð@Ð@Ð@r;   c                 ó  — t          |t          ¦  «        r"t          d                     |¦  «        ¦  «        ‚|                      |¦  «        \  }}| j                             |i ¦  «                             |i ¦  «        }|||<   dS )zq
        :type key: None|str
        :type code_or_exception: int|T<=Exception
        :type f: callable
        z‡Tried to register a handler for an exception instance {0!r}. Handlers can only be registered for exception classes or HTTP error codes.N)r7   r   rŠ   ÚformatrB  r“   r  )rA   ÚkeyrG  rD   rA  r?  Úhandlerss          r9   rF  zFlask._register_error_handler¤  s�   € õ Ð'­Ñ7Ô7ð 	,Ýð]ç’Ð)Ñ*Ô*ñ,ô ,ð ,ð
 ×6Ò6Ð7HÑIÔI‰ˆ	�4àÔ*×5Ò5°c¸2Ñ>Ô>×IÒIÈ$ÐPRÑSÔSˆØˆ�ÑÐÐr;   c                 ó   ‡ ‡— ˆˆ fd„}|S )a  A decorator that is used to register custom template filter.
        You can specify a name for the filter, otherwise the function
        name will be used. Example::

          @app.template_filter()
          def reverse(s):
              return s[::-1]

        :param name: the optional name of the filter, otherwise the
                     function name will be used.
        c                 ó6   •— ‰                      | ‰¬¦  «         | S ©N)r¦   )Úadd_template_filter©rD   r¦   rA   s    €€r9   r8  z(Flask.template_filter.<locals>.decoratorÃ  ó!   ø€ Ø×$Ò$ Q¨TÐ$Ñ2Ô2Ð2ØˆHr;   rç   ©rA   r¦   r8  s   `` r9   Útemplate_filterzFlask.template_filter¶  s*   øø€ ð	ð 	ð 	ð 	ð 	ð 	ð Ðr;   c                 ó2   — || j         j        |p|j        <   dS )zäRegister a custom template filter.  Works exactly like the
        :meth:`template_filter` decorator.

        :param name: the optional name of the filter, otherwise the
                     function name will be used.
        N)rÄ   râ   Ú__name__©rA   rD   r¦   s      r9   rR  zFlask.add_template_filterÈ  s    € ð 67ˆŒÔ˜tÐ1 q¤zÑ2Ð2Ð2r;   c                 ó   ‡ ‡— ˆˆ fd„}|S )aS  A decorator that is used to register custom template test.
        You can specify a name for the test, otherwise the function
        name will be used. Example::

          @app.template_test()
          def is_prime(n):
              if n == 2:
                  return True
              for i in range(2, int(math.ceil(math.sqrt(n))) + 1):
                  if n % i == 0:
                      return False
              return True

        .. versionadded:: 0.10

        :param name: the optional name of the test, otherwise the
                     function name will be used.
        c                 ó6   •— ‰                      | ‰¬¦  «         | S rQ  )Úadd_template_testrS  s    €€r9   r8  z&Flask.template_test.<locals>.decoratoræ  s!   ø€ Ø×"Ò" 1¨4Ð"Ñ0Ô0Ð0ØˆHr;   rç   rU  s   `` r9   Útemplate_testzFlask.template_testÒ  s*   øø€ ð(	ð 	ð 	ð 	ð 	ð 	ð Ðr;   c                 ó2   — || j         j        |p|j        <   dS )zþRegister a custom template test.  Works exactly like the
        :meth:`template_test` decorator.

        .. versionadded:: 0.10

        :param name: the optional name of the test, otherwise the
                     function name will be used.
        N)rÄ   ÚtestsrX  rY  s      r9   r\  zFlask.add_template_testë  s    € ð 45ˆŒÔ˜TÐ/ Q¤ZÑ0Ð0Ð0r;   c                 ó   ‡ ‡— ˆˆ fd„}|S )a¿  A decorator that is used to register a custom template global function.
        You can specify a name for the global function, otherwise the function
        name will be used. Example::

            @app.template_global()
            def double(n):
                return 2 * n

        .. versionadded:: 0.10

        :param name: the optional name of the global function, otherwise the
                     function name will be used.
        c                 ó6   •— ‰                      | ‰¬¦  «         | S rQ  )Úadd_template_globalrS  s    €€r9   r8  z(Flask.template_global.<locals>.decorator  rT  r;   rç   rU  s   `` r9   Útemplate_globalzFlask.template_global÷  s*   øø€ ð	ð 	ð 	ð 	ð 	ð 	ð Ðr;   c                 ó2   — || j         j        |p|j        <   dS )a  Register a custom template global function. Works exactly like the
        :meth:`template_global` decorator.

        .. versionadded:: 0.10

        :param name: the optional name of the global function, otherwise the
                     function name will be used.
        N)rÄ   rß   rX  rY  s      r9   rb  zFlask.add_template_global  s    € ð 67ˆŒÔ˜tÐ1 q¤zÑ2Ð2Ð2r;   c                 ób   — | j                              dg ¦  «                             |¦  «         |S )a  Registers a function to run before each request.

        The function will be called without any arguments.
        If the function returns a non-None value, it's handled as
        if it was the return value from the view and further
        request handling is stopped.
        N)r•   r  r  ©rA   rD   s     r9   Úbefore_requestzFlask.before_request  s0   € ð 	Ô!×,Ò,¨T°2Ñ6Ô6×=Ò=¸aÑ@Ô@Ð@Øˆr;   c                 ó:   — | j                              |¦  «         |S )zðRegisters a function to be run before the first request to this
        instance of the application.

        The function will be called without any arguments and its return
        value is ignored.

        .. versionadded:: 0.8
        )r–   r  rf  s     r9   Úbefore_first_requestzFlask.before_first_request#  s    € ð 	Ô'×.Ò.¨qÑ1Ô1Ð1Øˆr;   c                 ób   — | j                              dg ¦  «                             |¦  «         |S )au  Register a function to be run after each request.

        Your function must take one parameter, an instance of
        :attr:`response_class` and return a new response object or the
        same (see :meth:`process_response`).

        As of Flask 0.7 this function might not be executed at the end of the
        request in case an unhandled exception occurred.
        N)r—   r  r  rf  s     r9   Úafter_requestzFlask.after_request0  s0   € ð 	Ô ×+Ò+¨D°"Ñ5Ô5×<Ò<¸QÑ?Ô?Ð?Øˆr;   c                 ób   — | j                              dg ¦  «                             |¦  «         |S )a�  Register a function to be run at the end of each request,
        regardless of whether there was an exception or not.  These functions
        are executed when the request context is popped, even if not an
        actual request was performed.

        Example::

            ctx = app.test_request_context()
            ctx.push()
            ...
            ctx.pop()

        When ``ctx.pop()`` is executed in the above example, the teardown
        functions are called just before the request context moves from the
        stack of active contexts.  This becomes relevant if you are using
        such constructs in tests.

        Generally teardown functions must take every necessary step to avoid
        that they will fail.  If they do execute code that might fail they
        will have to surround the execution of these code by try/except
        statements and log occurring errors.

        When a teardown function was called because of a exception it will
        be passed an error object.

        The return values of teardown functions are ignored.

        .. admonition:: Debug Note

           In debug mode Flask will not tear down a request on an exception
           immediately.  Instead it will keep it alive so that the interactive
           debugger can still access it.  This behavior can be controlled
           by the ``PRESERVE_CONTEXT_ON_EXCEPTION`` configuration variable.
        N)r˜   r  r  rf  s     r9   Úteardown_requestzFlask.teardown_request>  s1   € ðH 	Ô#×.Ò.¨t°RÑ8Ô8×?Ò?ÀÑBÔBÐBØˆr;   c                 ó:   — | j                              |¦  «         |S )a|  Registers a function to be called when the application context
        ends.  These functions are typically also called when the request
        context is popped.

        Example::

            ctx = app.app_context()
            ctx.push()
            ...
            ctx.pop()

        When ``ctx.pop()`` is executed in the above example, the teardown
        functions are called just before the app context moves from the
        stack of active contexts.  This becomes relevant if you are using
        such constructs in tests.

        Since a request context typically also manages an application
        context it would also be called when you pop a request context.

        When a teardown function was called because of an exception it will
        be passed an error object.

        The return values of teardown functions are ignored.

        .. versionadded:: 0.9
        )r™   r  rf  s     r9   Úteardown_appcontextzFlask.teardown_appcontexte  s    € ð8 	Ô&×-Ò-¨aÑ0Ô0Ð0Øˆr;   c                 óF   — | j         d                              |¦  «         |S )z0Registers a template context processor function.N)rœ   r  rf  s     r9   Úcontext_processorzFlask.context_processor„  s%   € ð 	Ô(¨Ô.×5Ò5°aÑ8Ô8Ð8Øˆr;   c                 ó:   — | j                              |¦  «         |S )zVRegisters a shell context processor function.

        .. versionadded:: 0.11
        )r�   r  rf  s     r9   Úshell_context_processorzFlask.shell_context_processorŠ  s    € ð 	Ô%×,Ò,¨QÑ/Ô/Ð/Øˆr;   c                 ób   — | j                              dg ¦  «                             |¦  «         |S )zÌRegisters a function as URL value preprocessor for all view
        functions of the application.  It's called before the view functions
        are called and can modify the url values provided.
        N)rš   r  r  rf  s     r9   Úurl_value_preprocessorzFlask.url_value_preprocessor“  s0   € ð 	Ô$×/Ò/°°bÑ9Ô9×@Ò@ÀÑCÔCÐCØˆr;   c                 ób   — | j                              dg ¦  «                             |¦  «         |S )z¾Callback function for URL defaults for all view functions of the
        application.  It's called with the endpoint and values and should
        update the values passed in place.
        N)r›   r  r  rf  s     r9   Úurl_defaultszFlask.url_defaultsœ  s0   € ð 	Ô"×-Ò-¨d°BÑ7Ô7×>Ò>¸qÑAÔAÐAØˆr;   c                 ó4  ‡— |                       t          |¦  «        ¦  «        \  Š}ˆfd„} || j                             t          j        i ¦  «                             |¦  «        ¦  «        }|�|S  || j        d                              |¦  «        ¦  «        S )uª   Finds a registered error handler for the requestâ€™s blueprint.
        Otherwise falls back to the app, returns None if not a suitable
        handler is found.
        c                 ó,  •— | sd S t          ‰j        ¦  «        }t          ¦   «         }|rj|                     ¦   «         }||v rŒ|                     |¦  «         |                      |¦  «        }|�|| ‰<   |S |                     |j        ¦  «         |°hd S d S rJ   )r   Ú__mro__r0  Úpopleftr1  r3  Úextend)Úhandler_mapÚqueueÚdoner  ÚhandlerrA  s        €r9   Úfind_handlerz/Flask._find_error_handler.<locals>.find_handler¬  s³   ø€ Øð Ø�Ý˜)Ô+Ñ,Ô,ˆEõ ‘5”5ˆDàð *Ø—m’m‘o”o�Ø˜$�;�;ØØ—’˜‘”�Ø%Ÿ/š/¨#Ñ.Ô.�ØÐ&à-4�K 	Ñ*Ø"�Nà—’˜Sœ[Ñ)Ô)Ð)ð ð *ð *ð *ð *ð *r;   N)rB  Útyper“   r3  r%   rî   )rA   Úer?  r�  r€  rA  s        @r9   Ú_find_error_handlerzFlask._find_error_handler¥  s¥   ø€ ð
 ×6Ò6µt¸A±w´wÑ?Ô?‰ˆ	�4ð	*ð 	*ð 	*ð 	*ð 	*ð, �,˜tÔ6ß #¢¥GÔ$5°rÑ :Ô :ß #¢ D¡	¤	ñ+ô +ˆð ÐØˆNð ˆ|˜DÔ3°DÔ9×=Ò=¸dÑCÔCÑDÔDÐDr;   c                 ó\   — |j         €|S |                      |¦  «        }|€|S  ||¦  «        S )zÃHandles an HTTP exception.  By default this will invoke the
        registered error handlers and fall back to returning the
        exception as response.

        .. versionadded:: 0.3
        )r?  r„  )rA   rƒ  r€  s      r9   Úhandle_http_exceptionzFlask.handle_http_exceptionË  s;   € ð Œ6ˆ>ØˆHà×*Ò*¨1Ñ-Ô-ˆØˆ?ØˆHØˆw�q‰zŒzÐr;   c                 óh   — | j         d         rdS | j         d         rt          |t          ¦  «        S dS )a�  Checks if an HTTP exception should be trapped or not.  By default
        this will return ``False`` for all exceptions except for a bad request
        key error if ``TRAP_BAD_REQUEST_ERRORS`` is set to ``True``.  It
        also returns ``True`` if ``TRAP_HTTP_EXCEPTIONS`` is set to ``True``.

        This is called for all HTTP exceptions raised by a view function.
        If it returns ``True`` for any exception the error handler for this
        exception is not called and it shows up as regular exception in the
        traceback.  This is helpful for debugging implicitly raised HTTP
        exceptions.

        .. versionadded:: 0.8
        rq   Trp   F)r�   r7   r   )rA   rƒ  s     r9   Útrap_http_exceptionzFlask.trap_http_exceptionÜ  s>   € ð Œ;Ð-Ô.ð 	Ø�4ØŒ;Ð0Ô1ð 	-Ý˜a¥Ñ,Ô,Ð,Øˆur;   c                 ó   — t          j        ¦   «         \  }}}||u sJ ‚t          |t          ¦  «        r*|                      |¦  «        s|                      |¦  «        S |                      |¦  «        }|€t          |||¦  «          ||¦  «        S )a’  This method is called whenever an exception occurs that should be
        handled.  A special case are
        :class:`~werkzeug.exception.HTTPException`\s which are forwarded by
        this function to the :meth:`handle_http_exception` method.  This
        function will either return a response value or reraise the
        exception with the same traceback.

        .. versionadded:: 0.7
        )r±   Úexc_infor7   r   rˆ  r†  r„  r1   ©rA   rƒ  Úexc_typeÚ	exc_valueÚtbr€  s         r9   Úhandle_user_exceptionzFlask.handle_user_exceptionð  s˜   € õ #&¤,¡.¤.Ñˆ�)˜RØ˜Aˆ~ˆ~ˆ~ˆ~õ �a�Ñ'Ô'ð 	1°×0HÒ0HÈÑ0KÔ0Kð 	1Ø×-Ò-¨aÑ0Ô0Ð0à×*Ò*¨1Ñ-Ô-ˆàˆ?Ý�H˜i¨Ñ,Ô,Ð,Øˆw�q‰zŒzÐr;   c                 óB  — t          j        ¦   «         \  }}}t          j        | |¬¦  «         |                      t          ¦   «         ¦  «        }| j        r||u rt          |||¦  «         n|‚|                      |||f¦  «         |€t          ¦   «         S  ||¦  «        S )a  Default exception handling that kicks in when an exception
        occurs that is not caught.  In debug mode the exception will
        be re-raised immediately, otherwise it is logged and the handler
        for a 500 internal server error is used.  If no such handler
        exists, a default 500 internal server error message is displayed.

        .. versionadded:: 0.3
        )Ú	exception)	r±   rŠ  r.   Úsendr„  r   rº   r1   Úlog_exceptionr‹  s         r9   Úhandle_exceptionzFlask.handle_exception  s°   € õ #&¤,¡.¤.Ñˆ�)˜RåÔ" 4°1Ð5Ñ5Ô5Ð5Ø×*Ò*Õ+>Ñ+@Ô+@ÑAÔAˆàÔ$ð 	ð
 ˜Aˆ~ˆ~Ý˜ )¨RÑ0Ô0Ð0Ð0à�à×Ò˜H i°Ð4Ñ5Ô5Ð5Øˆ?Ý&Ñ(Ô(Ð(Øˆw�q‰zŒzÐr;   c                 ót   — | j                              dt          j        ›dt          j        ›d�|¬¦  «         dS )a  Logs an exception.  This is called by :meth:`handle_exception`
        if debugging is disabled and right before the handler is called.
        The default implementation logs the exception as error on the
        :attr:`logger`.

        .. versionadded:: 0.8
        zException on z [ú])rŠ  N)rÁ   Úerrorr%   rˆ   Úmethod)rA   rŠ  s     r9   r“  zFlask.log_exception(  sL   € ð 	Œ×ÒÐÝŒLˆLˆLÝŒNˆNˆNð
ð ð 	ñ 	ô 	ð 	ð 	ð 	r;   c                 ó†   — | j         r#t          |j        t          ¦  «        r	|j        dv r|j        ‚ddlm}  ||¦  «        ‚)a.  Exceptions that are recording during routing are reraised with
        this method.  During debug we are not reraising redirect requests
        for non ``GET``, ``HEAD``, or ``OPTIONS`` requests and we're raising
        a different error instead to help debug situations.

        :internal:
        )r%  ÚHEADr-  r   )ÚFormDataRoutingRedirect)r>   r7   Úrouting_exceptionr   r˜  Údebughelpersr›  )rA   r%   r›  s      r9   Úraise_routing_exceptionzFlask.raise_routing_exception5  s]   € ð Œzð 	,Ý˜WÔ6½ÑHÔHð	,àŒnÐ :Ð:Ð:ØÔ+Ð+à9Ð9Ð9Ð9Ð9Ð9Ø%Ð% gÑ.Ô.Ð.r;   c                 ó  — t           j        j        }|j        �|                      |¦  «         |j        }t          |dd¦  «        r|j        dk    r|                      ¦   «         S  | j	        |j
                 di |j        ¤ŽS )a·  Does the request dispatching.  Matches the URL and returns the
        return value of the view or error handler.  This does not have to
        be a response object.  In order to convert the return value to a
        proper response object, call :func:`make_response`.

        .. versionchanged:: 0.7
           This no longer does the exception handling, this code was
           moved to the new :meth:`full_dispatch_request`.
        Nr,  Fr-  rç   )r$   rí   r%   rœ  rž  Úurl_ruler°   r˜  Úmake_default_options_responser‘   r�   Ú	view_args)rA   Úreqr4  s      r9   Údispatch_requestzFlask.dispatch_requestE  s‹   € õ !Ô$Ô,ˆØÔ Ð,Ø×(Ò(¨Ñ-Ô-Ð-ØŒ|ˆõ �4Ð4°eÑ<Ô<ð 	8ØŒz˜YÒ&Ð&Ø×5Ò5Ñ7Ô7Ð7à1ˆtÔ" 4¤=Ô1ÐBÐB°C´MÐBÐBÐBr;   c                 ó†  — |                       ¦   «          	 t          j        | ¦  «         |                      ¦   «         }|€|                      ¦   «         }n,# t
          $ r}|                      |¦  «        }Y d}~nd}~ww xY w|                      |¦  «        }|                      |¦  «        }t          j        | |¬¦  «         |S )zÀDispatches the request and on top of that performs request
        pre and postprocessing as well as HTTP exception catching and
        error handling.

        .. versionadded:: 0.7
        N)r  )
Ú*try_trigger_before_first_request_functionsr,   r’  Úpreprocess_requestr¤  r>  r�  Úmake_responseÚprocess_responser-   )rA   r¹   rƒ  r  s       r9   Úfull_dispatch_requestzFlask.full_dispatch_request[  sÑ   € ð 	×7Ò7Ñ9Ô9Ð9ð	/ÝÔ  Ñ&Ô&Ð&Ø×(Ò(Ñ*Ô*ˆBØˆzØ×*Ò*Ñ,Ô,�øøÝð 	/ð 	/ð 	/Ø×+Ò+¨AÑ.Ô.ˆBˆBˆBˆBˆBˆBøøøøð	/øøøà×%Ò% bÑ)Ô)ˆØ×(Ò(¨Ñ2Ô2ˆÝÔ˜d¨XÐ6Ñ6Ô6Ð6Øˆs   –>A Á
A>ÁA9Á9A>c                 ó¸   — | j         rdS | j        5  | j         r	 ddd¦  «         dS | j        D ]} |¦   «          Œd| _         ddd¦  «         dS # 1 swxY w Y   dS )zÝCalled before each request and will ensure that it triggers
        the :attr:`before_first_request_funcs` and only exactly once per
        application instance (which means process usually).

        :internal:
        NT)r?   r¡   r–   )rA   rõ   s     r9   r¦  z0Flask.try_trigger_before_first_request_functionso  sà   € ð Ô"ð 	ØˆFØÔ&ð 	+ð 	+ØÔ&ð Øð	+ð 	+ð 	+ñ 	+ô 	+ð 	+ð 	+ð 	+ð Ô7ð ð �Ø�‘”��Ø&*ˆDÔ#ð	+ð 	+ð 	+ñ 	+ô 	+ð 	+ð 	+ð 	+ð 	+ð 	+ð 	+ð 	+øøøð 	+ð 	+ð 	+ð 	+ð 	+ð 	+s   ‘	A§AÁAÁAc                 ób  — t           j        j        }t          |d¦  «        r|                     ¦   «         }nJg }	 |                     d¬¦  «         n0# t          $ r}|j        }Y d}~nd}~wt          $ r
}Y d}~nd}~ww xY w|  	                    ¦   «         }|j
                             |¦  «         |S )zÚThis method is called to create the default ``OPTIONS`` response.
        This can be changed through subclassing to change the default
        behavior of ``OPTIONS`` responses.

        .. versionadded:: 0.7
        Úallowed_methodsz--)r˜  N)r$   rí   Úurl_adapterÚhasattrr­  Úmatchr   Úvalid_methodsr   r  Úallowrà   )rA   Úadapterr$  rƒ  r¹   s        r9   r¡  z#Flask.make_default_options_response  sÓ   € õ %Ô(Ô4ˆÝ�7Ð-Ñ.Ô.ð 
	Ø×-Ò-Ñ/Ô/ˆGˆGð ˆGðØ—’ T�Ñ*Ô*Ð*Ð*øÝ#ð *ð *ð *Øœ/������øøøøÝ ð ð ð Ø����øøøøðøøøà× Ò Ñ"Ô"ˆØ
Œ�Š˜Ñ Ô Ð Øˆ	s   ºA Á
A>ÁA'Á'A>Á9A>c                 ó   — dS )a
  This is called to figure out if an error should be ignored
        or not as far as the teardown system is concerned.  If this
        function returns ``True`` then the teardown handlers will not be
        passed the error.

        .. versionadded:: 0.10
        Frç   )rA   r—  s     r9   Úshould_ignore_errorzFlask.should_ignore_error–  s	   € ð ˆur;   c                 óH  — dx}}t          |t          ¦  «        r|ddt          |¦  «        z
  z  z   \  }}}|€t          d¦  «        ‚t          |t          t
          f¦  «        r|d}}t          || j        ¦  «        sdt          |t          t          t          f¦  «        r|                      |||¬¦  «        }dx}}n%| j         
                    |t          j        ¦  «        }|�$t          |t          ¦  «        r||_        n||_        |r|j                             |¦  «         |S )a­  Converts the return value from a view function to a real
        response object that is an instance of :attr:`response_class`.

        The following types are allowed for `rv`:

        .. tabularcolumns:: |p{3.5cm}|p{9.5cm}|

        ======================= ===========================================
        :attr:`response_class`  the object is returned unchanged
        :class:`str`            a response object is created with the
                                string as body
        :class:`unicode`        a response object is created with the
                                string encoded to utf-8 as body
        a WSGI function         the function is called as WSGI application
                                and buffered as response object
        :class:`tuple`          A tuple in the form ``(response, status,
                                headers)`` or ``(response, headers)``
                                where `response` is any of the
                                types defined here, `status` is a string
                                or an integer and `headers` is a list or
                                a dictionary with header values.
        ======================= ===========================================

        :param rv: the return value from the view function

        .. versionchanged:: 0.9
           Previously a tuple was interpreted as the arguments for the
           response object.
        NrJ   é   z'View function did not return a response)ÚheadersÚstatus)r7   ÚtupleÚlenrŠ   rÛ   Úlistr  r3   ÚbytesÚ	bytearrayÚ
force_typer%   Úenvironr2   r¹  Ústatus_coder¸  r|  )rA   r¹   Ústatus_or_headersr¸  s       r9   r¨  zFlask.make_response   sB  € ð< '+Ð*Ð˜GÝ�b�%Ñ Ô ð 	JØ-/°'¸QÅÀRÁÄ¹[Ñ2IÑ-IÑ*ˆBÐ! 7àˆ:ÝÐFÑGÔGÐGåÐ'­$µ¨Ñ6Ô6ð 	AØ):¸DÐ&ˆGå˜"˜dÔ1Ñ2Ô2ð 
	Iõ
 ˜"�y­%µÐ;Ñ<Ô<ð IØ×(Ò(¨°WØ0Að )ñ Cô C�à.2Ð2�Ð+Ð+àÔ(×3Ò3°B½¼ÑHÔH�àÐ(ÝÐ+­\Ñ:Ô:ð 3Ø-�”	�	à!2�”Øð 	'ØŒJ×Ò˜gÑ&Ô&Ð&àˆ	r;   c                 óü   — |�,| j                              |j        | j        d         ¬¦  «        S | j        d         �@| j                              | j        d         | j        d         pd| j        d         ¬¦  «        S dS )a…  Creates a URL adapter for the given request.  The URL adapter
        is created at a point where the request context is not yet set up
        so the request is passed explicitly.

        .. versionadded:: 0.6

        .. versionchanged:: 0.9
           This can now also be called without a request object when the
           URL adapter is created for the application context.
        Nre   )r  rf   ú/rs   )Úscript_nameÚ
url_scheme)r    Úbind_to_environrÀ  r�   Úbindr  s     r9   Úcreate_url_adapterzFlask.create_url_adapterÞ  s•   € ð ÐØ”<×/Ò/°´Ø œK¨Ô6ð 0ñ 8ô 8ð 8ð Œ;�}Ô%Ð1Ø”<×$Ò$Ø”˜MÔ*Ø œKÐ(:Ô;ÐB¸sØœ;Ð'=Ô>ð %ñ @ô @ð @ð 2Ð1r;   c                 óð   — | j                              dd¦  «        }d|v rE|                     dd¦  «        d         }t          || j                              |d¦  «        ¦  «        }|D ]} |||¦  «         ŒdS )zÖInjects the URL defaults for the given endpoint directly into
        the values dictionary passed.  This is used internally and
        automatically called on URL building.

        .. versionadded:: 0.7
        Nrç   ú.r   r   )r›   r3  r  r   )rA   r�   Úvaluesrñ   ró   rõ   s         r9   Úinject_url_defaultszFlask.inject_url_defaultsô  s�   € ð Ô*×.Ò.¨t°RÑ8Ô8ˆØ�(ˆ?ˆ?Ø—’  aÑ(Ô(¨Ô+ˆBÝ˜% Ô!;×!?Ò!?ÀÀBÑ!GÔ!GÑHÔHˆEØð 	#ð 	#ˆDØˆD�˜6Ñ"Ô"Ð"Ð"ð	#ð 	#r;   c                 óÌ   — t          j        ¦   «         \  }}}| j        D ]/}	  ||||¦  «        }|�|c S Œ# t          $ r}	|	}Y d}	~	Œ(d}	~	ww xY w||u rt	          |||¦  «         |‚)zIHandle :class:`~werkzeug.routing.BuildError` on :meth:`url_for`.
        N)r±   rŠ  r”   r   r1   )
rA   r—  r�   rÌ  rŒ  r�  rŽ  r€  r¹   rƒ  s
             r9   Úhandle_url_build_errorzFlask.handle_url_build_error  s¥   € õ #&¤,¡.¤.Ñˆ�)˜RØÔ4ð 	ð 	ˆGðØ�W˜U H¨fÑ5Ô5�Ø�>Ø�I�I�Ið "øåð ð ð à������øøøøðøøøð �IÐÐÝ�H˜i¨Ñ,Ô,Ð,Øˆs   ¢6¶
AÁ AÁAc                 óª  — t           j        j        j        }| j                             dd¦  «        }|�$|| j        v rt          || j        |         ¦  «        }|D ]"} |t          j        t          j        ¦  «         Œ#| j	                             dd¦  «        }|�$|| j	        v rt          || j	        |         ¦  «        }|D ]} |¦   «         }|�|c S ŒdS )aË  Called before the actual request dispatching and will
        call each :meth:`before_request` decorated function, passing no
        arguments.
        If any of these functions returns a value, it's handled as
        if it was the return value from the view and further
        request handling is stopped.

        This also triggers the :meth:`url_value_processor` functions before
        the actual :meth:`before_request` functions are called.
        Nrç   )
r$   rí   r%   rî   rš   r3  r   r�   r¢  r•   )rA   ró   rñ   rõ   r¹   s        r9   r§  zFlask.preprocess_request  sõ   € õ  Ô#Ô+Ô5ˆàÔ,×0Ò0°°rÑ:Ô:ˆØˆ>˜b DÔ$@Ð@Ð@Ý˜% Ô!=¸bÔ!AÑBÔBˆEØð 	6ð 	6ˆDØˆD•Ô!¥7Ô#4Ñ5Ô5Ð5Ð5àÔ)×-Ò-¨d°BÑ7Ô7ˆØˆ>˜b DÔ$=Ð=Ð=Ý˜% Ô!:¸2Ô!>Ñ?Ô?ˆEØð 	ð 	ˆDØ�‘”ˆBØˆ~Ø�	�	�	ð ð	ð 	r;   c                 ó   — t           j        }|j        j        }|j        }|�1|| j        v r(t          |t          | j        |         ¦  «        ¦  «        }d| j        v r(t          |t          | j        d         ¦  «        ¦  «        }|D ]} ||¦  «        }Œ| j         	                    |j
        ¦  «        s|                      |j
        |¦  «         |S )a  Can be overridden in order to modify the response object
        before it's sent to the WSGI server.  By default this will
        call all the :meth:`after_request` decorated functions.

        .. versionchanged:: 0.5
           As of Flask 0.5 the functions registered for after request
           execution are called in reverse order of registration.

        :param response: a :attr:`response_class` object.
        :return: a new response object or the same, has to be an
                 instance of :attr:`response_class`.
        N)r$   rí   r%   rî   Ú_after_request_functionsr—   r   Úreversedr  Úis_null_sessionr&   r  )rA   r  Úctxró   rñ   r€  s         r9   r©  zFlask.process_response1  sÔ   € õ !Ô$ˆØŒ[Ô"ˆØÔ,ˆØˆ>˜b DÔ$<Ð<Ð<Ý˜%¥¨$Ô*BÀ2Ô*FÑ!GÔ!GÑHÔHˆEØ�4Ô+Ð+Ð+Ý˜%¥¨$Ô*BÀ4Ô*HÑ!IÔ!IÑJÔJˆEØð 	)ð 	)ˆGØ�w˜xÑ(Ô(ˆHˆHØÔ%×5Ò5°c´kÑBÔBð 	5Ø×Ò˜cœk¨8Ñ4Ô4Ð4Øˆr;   c                 óx  — |t           u rt          j        ¦   «         d         }t          | j                             dd¦  «        ¦  «        }t          j        j        j	        }|�1|| j        v r(t          |t          | j        |         ¦  «        ¦  «        }|D ]} ||¦  «         Œt          j        | |¬¦  «         dS )a  Called after the actual request dispatching and will
        call every as :meth:`teardown_request` decorated function.  This is
        not actually called by the :class:`Flask` object itself but is always
        triggered when the request context is popped.  That way we have a
        tighter control over certain resources under testing environments.

        .. versionchanged:: 0.9
           Added the `exc` argument.  Previously this was always using the
           current exception information.
        r   Nrç   ©Úexc)Ú	_sentinelr±   rŠ  rÓ  r˜   r3  r$   rí   r%   rî   r   r/   r’  )rA   rØ  rñ   ró   rõ   s        r9   Údo_teardown_requestzFlask.do_teardown_requestK  s¸   € ð •)ÐÐÝ”,‘.”. Ô#ˆCÝ˜Ô4×8Ò8¸¸rÑBÔBÑCÔCˆÝÔ#Ô+Ô5ˆØˆ>˜b DÔ$?Ð?Ð?Ý˜%¥¨$Ô*EÀbÔ*IÑ!JÔ!JÑKÔKˆEØð 	ð 	ˆDØˆD�‰IŒIˆIˆIÝÔ! $¨CÐ0Ñ0Ô0Ð0Ð0Ð0r;   c                 óº   — |t           u rt          j        ¦   «         d         }t          | j        ¦  «        D ]} ||¦  «         Œt          j        | |¬¦  «         dS )zÆCalled when an application context is popped.  This works pretty
        much the same as :meth:`do_teardown_request` but for the application
        context.

        .. versionadded:: 0.9
        r   r×  N)rÙ  r±   rŠ  rÓ  r™   r0   r’  )rA   rØ  rõ   s      r9   Údo_teardown_appcontextzFlask.do_teardown_appcontext`  sd   € ð •)ÐÐÝ”,‘.”. Ô#ˆCÝ˜TÔ;Ñ<Ô<ð 	ð 	ˆDØˆD�‰IŒIˆIˆIÝÔ$ T¨sÐ3Ñ3Ô3Ð3Ð3Ð3r;   c                 ó    — t          | ¦  «        S )a‡  Binds the application only.  For as long as the application is bound
        to the current context the :data:`flask.current_app` points to that
        application.  An application context is automatically created when a
        request context is pushed if necessary.

        Example usage::

            with app.app_context():
                ...

        .. versionadded:: 0.9
        )r"   rL   s    r9   Úapp_contextzFlask.app_contextm  s   € õ ˜$ÑÔÐr;   c                 ó"   — t          | |¦  «        S )aØ  Creates a :class:`~flask.ctx.RequestContext` from the given
        environment and binds it to the current context.  This must be used in
        combination with the ``with`` statement because the request is only bound
        to the current context for the duration of the ``with`` block.

        Example usage::

            with app.request_context(environ):
                do_something_with(request)

        The object returned can also be used without the ``with`` statement
        which is useful for working in the shell.  The example above is
        doing exactly the same as this code::

            ctx = app.request_context(environ)
            ctx.push()
            try:
                do_something_with(request)
            finally:
                ctx.pop()

        .. versionchanged:: 0.3
           Added support for non-with statement usage and ``with`` statement
           is now passed the ctx object.

        :param environ: a WSGI environment
        )r!   )rA   rÀ  s     r9   Úrequest_contextzFlask.request_context|  s   € õ8 ˜d GÑ,Ô,Ð,r;   c                 óÐ   — ddl m}  || g|¢R i |¤Ž}	 |                      |                     ¦   «         ¦  «        |                     ¦   «          S # |                     ¦   «          w xY w)zµCreates a WSGI environment from the given values (see
        :class:`werkzeug.test.EnvironBuilder` for more information, this
        function accepts the same arguments).
        r   )Úmake_test_environ_builder)r  râ  rà  Úget_environÚclose)rA   rB   rC   râ  Úbuilders        r9   Útest_request_contextzFlask.test_request_contextš  sy   € ð
 	<Ð;Ð;Ð;Ð;Ð;Ø+Ð+¨DÐB°4ÐBÐBÐB¸6ÐBÐBˆð	Ø×'Ò'¨×(;Ò(;Ñ(=Ô(=Ñ>Ô>à�MŠM‰OŒOˆOˆOøˆG�MŠM‰OŒOˆOˆOøøøs   ”&A ÁA%c                 óÚ  — |                       |¦  «        }|                     ¦   «          d}	 	 |                      ¦   «         }nA# t          $ r4}|}|                      |                      |¦  «        ¦  «        }Y d}~nd}~ww xY w |||¦  «        |                      |¦  «        rd}|                     |¦  «         S # |                      |¦  «        rd}|                     |¦  «         w xY w)a  The actual WSGI application.  This is not implemented in
        `__call__` so that middlewares can be applied without losing a
        reference to the class.  So instead of doing this::

            app = MyMiddleware(app)

        It's a better idea to do this instead::

            app.wsgi_app = MyMiddleware(app.wsgi_app)

        Then you still have the original application object around and
        can continue to call methods on it.

        .. versionchanged:: 0.7
           The behavior of the before and after request callbacks was changed
           under error conditions and a new callback was added that will
           always execute at the end of the request, independent on if an
           error occurred or not.  See :ref:`callbacks-and-errors`.

        :param environ: a WSGI environment
        :param start_response: a callable accepting a status code,
                               a list of headers and an optional
                               exception context to start the response
        N)rà  Úpushrª  r>  r¨  r”  rµ  Úauto_pop)rA   rÀ  Ústart_responserÕ  r—  r  rƒ  s          r9   Úwsgi_appzFlask.wsgi_app¦  s  € ð2 ×"Ò" 7Ñ+Ô+ˆØ�Š‰
Œ
ˆ
Øˆð
	 ðHØ×5Ò5Ñ7Ô7��øÝð Hð Hð HØ�Ø×-Ò-¨d×.CÒ.CÀAÑ.FÔ.FÑGÔG������øøøøðHøøøð �8˜G ^Ñ4Ô4à×'Ò'¨Ñ.Ô.ð Ø�Ø�LŠL˜ÑÔÐÐøð ×'Ò'¨Ñ.Ô.ð Ø�Ø�LŠL˜ÑÔÐÐøøøs/   ®A ÁB< Á
BÁ*A<Á7B< Á<BÂB< Â<.C*c                 ó.   — |                       ||¦  «        S )zShortcut for :attr:`wsgi_app`.)rë  )rA   rÀ  rê  s      r9   Ú__call__zFlask.__call__Î  s   € à�}Š}˜W nÑ5Ô5Ð5r;   c                 ó2   — d| j         j        ›d| j        ›d�S )Nú<ú ú>)Ú	__class__rX  r¦   rL   s    r9   Ú__repr__zFlask.__repr__Ò  s%   € € àŒNÔ#Ð#Ð#ØŒIˆIˆIð
ð 	
r;   )NNry   rz   NFN)F)rÑ   )NNN)T)NNrJ   )yrX  Ú
__module__Ú__qualname__Ú__doc__r   Úrequest_classr   r  r*   rÞ   r#   rK   rM   rS   ÚpropertyÚrequest_globals_classr    rÈ   r   r>   r·   Ú
secret_keyÚsession_cookie_namer:   Úpermanent_session_lifetimeÚsend_file_max_age_defaultÚuse_x_sendfiler�   r   ÚJSONEncoderÚjson_encoderÚJSONDecoderÚjson_decoderr	   rÜ   r   r   rÉ   r   r2  r  r(   r  rƒ   rª   r¬   Úerror_handlersr   r¦   rº   r¼   rÁ   rÄ   rÆ   rŒ   r†   rÖ   rÃ   rå   rè   rÝ   rö   rú   r	  r  r  r  r  rF   r  r"  r£   r9  r�   ÚstaticmethodrB  rH  rJ  rF  rV  rR  r]  r\  rc  rb  rg  ri  rk  rm  ro  rq  rs  ru  rw  r„  r†  rˆ  r�  r”  r“  rž  r¤  rª  r¦  r¡  rµ  r¨  rÉ  rÍ  rÏ  r§  r©  rÙ  rÚ  rÜ  rÞ  rà  ræ  rë  rí  ró  rç   r;   r9   rH   rH   E   sù  € € € € € ðQð Qðj €Mð €Nð
 $Ðð  +Ðð*ð *ð *ð+ð +ð +ð
 %˜HÐ%?Ø%?ñAô AÐà"Ð$>ð €Lð ˆO˜GÑ$Ô$€Eð ˆo˜iÑ(Ô(€Gð !� Ñ.Ô.€Jð *˜/Ð*?Ñ@Ô@Ðð "1 Ð1MØ%ð"'ñ "'ô "'Ðð !0 Ð0KØ%ð!'ñ !'ô !'Ðð %�_Ð%5Ñ6Ô6€Nð "�/ -Ñ0Ô0€Kð
 Ô#€Lð
 Ô#€Lð "�MØ+Ð-?Ð@ðñ ô €Mð
 #�]ð $Ø°°ÀuÐ0MÑ0MÔ0Mð$à°ð$ð 	°ð$ð 	(°ð	$ð
 	°ð$ð 	%°	°	¸rÐ0BÑ0BÔ0Bð$ð 	°ð$ð 	°ð$ð 	 ¨xð$ð 	°ð$ð 	°ð$ð 	°	ð$ð 	 °ð$ð 	°ð$ð 	"°ð$ð  	 °ð!$ð" 	'°ð#$ð$ 15Ø09°	ÀÐ0CÑ0CÔ0CØ05Ø05Ø05Ø06Ø04Ø04Ø04Ø0BØ04ð9$ð $ð $ñ ô €NðF €Nð
 Ðð 5Ð4Ñ6Ô6ÐàFJØ9DØ>CØðR+ð R+ð R+ð R+ðh$ð $ð $ð
.ð .ð .ð �XÐ1Ð3FÑGÔG€NØÐ0àð ð  ñ Ôð ð  ð	*ð 	*ñ „Xð	*ð ð
ð 
ñ „Xð
ð ðð ñ „Xðð* ð/ð /ñ Ôð/ð ð'ð 'ñ „Xð'ðAð Að Að AðDð Dð Dð
Fð 
Fð 
Fð 
Fð ð  ð  ðD,ð ,ð ,ðð ð ðFð Fð Fð!ð !ð !ð2
ð 
ð 
ðA,ð A,ð A,ð A,ðF6Qð 6Qð 6Qð 6QðpBð Bð Bð
Lð 
Lð 
Lð>ð >ð >ð ð>ð >ñ „[ð>ðB+ð +ð +ð ð[6ð [6ð [6ñ „[ð[6ðzð ð ð< ðð ñ „[ðð ð#ð #ñ „\ð#ð ð,ð ,ñ „[ð,ð\Að Að Að ð ð  ñ „[ð ð" ðð ð ñ „[ðð" ð7ð 7ð 7ñ „[ð7ð ðð ð ñ „[ðð0 ð	5ð 	5ð 	5ñ „[ð	5ð ðð ð ñ „[ðð& ð	7ð 	7ð 	7ñ „[ð	7ð ð	ð 	ñ „[ð	ð ð
ð 
ñ „[ð
ð ðð ñ „[ðð ð$ð $ñ „[ð$ðL ðð ñ „[ðð< ðð ñ „[ðð
 ðð ñ „[ðð ðð ñ „[ðð ðð ñ „[ðð$Eð $Eð $EðLð ð ð"ð ð ð(ð ð ð6ð ð ð:ð ð ð/ð /ð /ð Cð Cð Cð,ð ð ð(+ð +ð +ð ð ð ð.ð ð ð<ð <ð <ð|@ð @ð @ð,#ð #ð #ðð ð ð(ð ð ð6ð ð ð4 '0ð 1ð 1ð 1ð 1ð* *3ð 4ð 4ð 4ð 4ð ð  ð  ð-ð -ð -ð<
ð 
ð 
ð& ð & ð & ðP6ð 6ð 6ð
ð 
ð 
ð 
ð 
r;   rH   )Krö  r‡   r±   Ú	threadingr   Údatetimer   Ú	itertoolsr   Ú	functoolsr   Úcollectionsr   Úwerkzeug.datastructuresr	   Úwerkzeug.routingr
   r   r   r   Úwerkzeug.exceptionsr   r   r   r   r   Úhelpersr   r   r   r   r   r   r   Ú r   r   Úwrappersr   r   r�   r   r    rÕ  r!   r"   r#   rß   r$   r%   r&   r'   Úsessionsr(   Ú
templatingr)   r*   r+   Úsignalsr,   r-   r.   r/   r0   Ú_compatr1   r2   r3   r4   r¿   ÚobjectrÙ  r:   rF   rH   rç   r;   r9   ú<module>r     s  ððð ð 
€	€	€	Ø 
€
€
€
Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ð Ð à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ Cð6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð Ð Ð Ð Ð Ð Ð Ð Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2ð%ð %ð %ð %ð %ð %ð %ð %ð %ð %ð3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3à DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ Dð ˆt‰vŒv€ð ˆF‰HŒH€	ðð ð ð+ð +ð +ð"Q
ð Q
ð Q
ð Q
ð Q
Ðñ Q
ô Q
ð Q
ð Q
ð Q
r;   