Sindbad~EG File Manager

Current Path : /home/infinitibizsol/mypythonenv/lib/python3.6/site-packages/flask/__pycache__/
Upload File :
Current File : /home/infinitibizsol/mypythonenv/lib/python3.6/site-packages/flask/__pycache__/views.cpython-36.pyc

3

Ĝg<�	@szddlZddlmZddlmZddlmZedddd	d
ddd
g�ZGdd�d�ZGdd�de	�Z
Gdd�dee
d�ZdS)�N�)�current_app)�request)�ResponseReturnValue�get�post�head�options�delete�put�trace�patchc@speZdZUdZdZejejedZ	eje
	gZejeje
d�dd�Zeeejejejd�dd��ZdS)	�Viewa�Alternative way to use view functions.  A subclass has to implement
    :meth:`dispatch_request` which is called with the view arguments from
    the URL routing system.  If :attr:`methods` is provided the methods
    do not have to be passed to the :meth:`~flask.Flask.add_url_rule`
    method explicitly::

        class MyView(View):
            methods = ['GET']

            def dispatch_request(self, name):
                return f"Hello {name}!"

        app.add_url_rule('/hello/<name>', view_func=MyView.as_view('myview'))

    When you want to decorate a pluggable view you will have to either do that
    when the view function is created (by wrapping the return value of
    :meth:`as_view`) or you can use the :attr:`decorators` attribute::

        class SecretView(View):
            methods = ['GET']
            decorators = [superuser_required]

            def dispatch_request(self):
                ...

    The decorators stored in the decorators list are applied one after another
    when the view function is created.  Note that you can *not* use the class
    based decorators since those would decorate the view class and not the
    generated view function!
    N)�returncCs
t��dS)z�Subclasses have to override this method to implement the
        actual view function code.  This method is called with all
        the arguments from the URL rule.
        N)�NotImplementedError)�self�r�,/tmp/pip-build-fsllo_ck/Flask/flask/views.py�dispatch_request>szView.dispatch_request)�name�
class_args�class_kwargsrcsztjtjtd����fdd��|jrJ|�_|j�_x|jD]}|���q:W|�_|�_|j�_|j�_|j�_|j	�_	�S)a�Converts the class into an actual view function that can be used
        with the routing system.  Internally this generates a function on the
        fly which will instantiate the :class:`View` on each request and call
        the :meth:`dispatch_request` method on it.

        The arguments passed to :meth:`as_view` are forwarded to the
        constructor of the class.
        )�args�kwargsrcs�j���}tj|j�||�S)N)�
view_classr�ensure_syncr)rrr)rr�viewrrrRszView.as_view.<locals>.view)
�t�Anyr�
decorators�__name__�
__module__r�__doc__�methods�provide_automatic_options)�clsrrrZ	decoratorr)rrrr�as_viewEs
zView.as_view)r r!�__qualname__r"r#r�Optional�List�strr$�boolr�Callablerr�classmethodrr&rrrrr
s

rcs eZdZdZ�fdd�Z�ZS)�MethodViewTypezYMetaclass for :class:`MethodView` that determines what methods the view
    defines.
    csxt�j|||�d|krtt�}x$|D]}t|dd�r$|j|j�q$Wx$tD]}t||�rJ|j|j	��qJW|rt||_dS)Nr#)
�super�__init__�set�getattr�updater#�http_method_funcs�hasattr�add�upper)r%r�bases�dr#�base�key)�	__class__rrr0os


zMethodViewType.__init__)r r!r'r"r0�
__classcell__rr)r<rr.jsr.c@s&eZdZdZejejed�dd�ZdS)�
MethodViewaA class-based view that dispatches request methods to the corresponding
    class methods. For example, if you implement a ``get`` method, it will be
    used to handle ``GET`` requests. ::

        class CounterAPI(MethodView):
            def get(self):
                return session.get('counter', 0)

            def post(self):
                session['counter'] = session.get('counter', 0) + 1
                return 'OK'

        app.add_url_rule('/counter', view_func=CounterAPI.as_view('counter'))
    )rrrcOsXt|tjj�d�}|dkr0tjdkr0t|dd�}|dk	sHtdtj����tj|�||�S)N�HEADrzUnimplemented method )r2r�method�lower�AssertionErrorrr)rrr�methrrrr�s
zMethodView.dispatch_requestN)r r!r'r"rrrrrrrrr>�sr>)�	metaclass)�typingr�globalsrrr�	frozensetr4r�typer.r>rrrr�<module>s]

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists