403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/flask/json/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/flask/json/__pycache__/provider.cpython-311.pyc
�

+�b�)����ddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZejrddlmZddlmZGd	�d
��Zdd�ZGd�de��ZdS)�)�annotationsN)�date)�	http_date�)�request)�Flask)�Responsec�J�eZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zd d�Z	d!d�Z
dS)"�JSONProvidera�A standard set of JSON operations for an application. Subclasses
    of this can be used to customize JSON behavior or use different
    JSON libraries.

    To implement a provider for a specific library, subclass this base
    class and implement at least :meth:`dumps` and :meth:`loads`. All
    other methods have default implementations.

    To use a different provider, either subclass ``Flask`` and set
    :attr:`~flask.Flask.json_provider_class` to a provider class, or set
    :attr:`app.json <flask.Flask.json>` to an instance of the class.

    :param app: An application instance. This will be stored as a
        :class:`weakref.proxy` on the :attr:`_app` attribute.

    .. versionadded:: 2.2
    �appr�return�Nonec�8�tj|��|_dS)N)�weakref�proxy�_app)�selfrs  �5/usr/lib/python3/dist-packages/flask/json/provider.py�__init__zJSONProvider.__init__'s���M�#�&�&��	�	�	��obj�t.Any�kwargs�strc��t�)z�Serialize data as JSON.

        :param obj: The data to serialize.
        :param kwargs: May be passed to the underlying JSON library.
        ��NotImplementedError)rrrs   r�dumpszJSONProvider.dumps*�
��"�!r�fp�	t.IO[str]c�H�|�|j|fi|����dS)aSerialize data as JSON and write to a file.

        :param obj: The data to serialize.
        :param fp: A file opened for writing text. Should use the UTF-8
            encoding to be valid JSON.
        :param kwargs: May be passed to the underlying JSON library.
        N)�writer)rrr rs    r�dumpzJSONProvider.dump2s0��	������C�*�*�6�*�*�+�+�+�+�+r�s�str | bytesc��t�)z�Deserialize data as JSON.

        :param s: Text or UTF-8 bytes.
        :param kwargs: May be passed to the underlying JSON library.
        r)rr%rs   r�loadszJSONProvider.loads<rr�t.IO[t.AnyStr]c�B�|j|���fi|��S)z�Deserialize data as JSON read from a file.

        :param fp: A file opened for reading text or UTF-8 bytes.
        :param kwargs: May be passed to the underlying JSON library.
        )r(�read)rr rs   r�loadzJSONProvider.loadDs&���t�z�"�'�'�)�)�.�.�v�.�.�.r�args�t.Tuple[t.Any, ...]�t.Dict[str, t.Any]c�r�|r|rtd���|s|sdSt|��dkr|dS|p|S)Nz9app.json.response() takes either args or kwargs, not both�r)�	TypeError�len)rr-rs   r�_prepare_response_objz"JSONProvider._prepare_response_objLsZ���	Y�F�	Y��W�X�X�X��	�F�	��4��t�9�9��>�>���7�N��~�v�rr	c��|�||��}|j�|�|��d���S)a(Serialize the given arguments as JSON, and return a
        :class:`~flask.Response` object with the ``application/json``
        mimetype.

        The :func:`~flask.json.jsonify` function calls this method for
        the current application.

        Either positional or keyword arguments can be given, not both.
        If no arguments are given, ``None`` is serialized.

        :param args: A single value to serialize, or multiple values to
            treat as a list to serialize.
        :param kwargs: Treat as a dict to serialize.
        �application/json��mimetype)r4r�response_classr)rr-rrs    r�responsezJSONProvider.responseZs?���(�(��v�6�6���y�'�'��
�
�3���BT�'�U�U�UrN)rrr
r�rrrrr
r)rrr r!rrr
r�r%r&rrr
r)r r)rrr
r)r-r.rr/r
r�r-rrrr
r	)�__name__�
__module__�__qualname__�__doc__rrr$r(r,r4r:�rrrrs���������$'�'�'�'�"�"�"�"�,�,�,�,�"�"�"�"�/�/�/�/�����V�V�V�V�V�Vrr�orr
c��t|t��rt|��St|tjt
jf��rt|��Str(tj	|��rtj
|��St|d��r!t|�����Stdt|��j�d����)N�__html__zObject of type z is not JSON serializable)�
isinstancerr�decimal�Decimal�uuid�UUIDr�dataclasses�is_dataclass�asdict�hasattrrEr2�typer>)rCs r�_defaultrPms����!�T������|�|���!�g�o�t�y�1�2�2���1�v�v�
��%�{�/��2�2�%��!�!�$�$�$��q�*���!��1�:�:�<�<� � � �
�Q�d�1�g�g�&6�Q�Q�Q�
R�
R�Rrc�p�eZdZUdZee��Zded<	dZ	dZ		dZ
ded<	dZ	dd�Zdd�Z
dd�ZdS)�DefaultJSONProvidera4Provide JSON operations using Python's built-in :mod:`json`
    library. Serializes the following additional data types:

    -   :class:`datetime.datetime` and :class:`datetime.date` are
        serialized to :rfc:`822` strings. This is the same as the HTTP
        date format.
    -   :class:`uuid.UUID` is serialized to a string.
    -   :class:`dataclasses.dataclass` is passed to
        :func:`dataclasses.asdict`.
    -   :class:`~markupsafe.Markup` (or any object with a ``__html__``
        method) will call the ``__html__`` method to get a string.
    zt.Callable[[t.Any], t.Any]�defaultTNzbool | None�compactr6rrrr
rc���|jj}tr)|jj�tj��nd}|�|j�|j}|�Zddl}|�dt��|�	d|��d|j
vr|�	d|j��n|�	d|j��|jjd}|jjd}|� ddl}|�dt��n|j
}|� ddl}|�d	t��n|j}|�	d
|��|�	d|��tj|fi|��S)aISerialize data as JSON to a string.

        Keyword arguments are passed to :func:`json.dumps`. Sets some
        parameter defaults from the :attr:`default`,
        :attr:`ensure_ascii`, and :attr:`sort_keys` attributes.

        :param obj: The data to serialize.
        :param kwargs: Passed to :func:`json.dumps`.
        Nrz~Setting 'json_encoder' on the app or a blueprint is deprecated and will be removed in Flask 2.3. Customize 'app.json' instead.�clsrS�
JSON_AS_ASCII�JSON_SORT_KEYSzsThe 'JSON_AS_ASCII' config key is deprecated and will be removed in Flask 2.3. Set 'app.json.ensure_ascii' instead.zqThe 'JSON_SORT_KEYS' config key is deprecated and will be removed in Flask 2.3. Set 'app.json.sort_keys' instead.�ensure_ascii�	sort_keys)r�
_json_encoderr�
blueprints�get�	blueprint�warnings�warn�DeprecationWarning�
setdefault�__dict__rS�configrYrZ�jsonr)rrrrV�bpr_rYrZs        rrzDefaultJSONProvider.dumps�s����i�%��<C�
M�T�Y�
!�
%�
%�g�&7�
8�
8�
8���
�>�b�.�:��"�C��?��O�O�O��M�M�1�#�	
�
�
�
���e�S�)�)�)����,�,��!�!�)�T�\�:�:�:�����i���6�6�6��y�'��8���I�$�%5�6�	��#��O�O�O��M�M��#�	
�
�
�
� �,�L�� ��O�O�O��M�M��#�	
�
�
�
���I����.�,�7�7�7����+�y�1�1�1��z�#�(�(��(�(�(rr%r&c�0�|jj}tr)|jj�tj��nd}|�|j�|j}|�5ddl}|�dt��|�	d|��tj|fi|��S)z�Deserialize data as JSON from a string or bytes.

        :param s: Text or UTF-8 bytes.
        :param kwargs: Passed to :func:`json.loads`.
        Nrz~Setting 'json_decoder' on the app or a blueprint is deprecated and will be removed in Flask 2.3. Customize 'app.json' instead.rV)r�
_json_decoderrr\r]r^r_r`rarbrer()rr%rrVrfr_s      rr(zDefaultJSONProvider.loads�s����i�%��<C�
M�T�Y�
!�
%�
%�g�&7�
8�
8�
8���
�>�b�.�:��"�C��?��O�O�O��M�M�1�#�	
�
�
�
���e�S�)�)�)��z�!�&�&�v�&�&�&rr-r	c��|�||��}i}|jjd}|jjd}|�#ddl}|�dt
��|}n|j}|�|jjs|dur|�dd��n|�d	d
��|� ddl}|�dt
��n|j	}|j�
|j|fi|���d�|�
��S)a�Serialize the given arguments as JSON, and return a
        :class:`~flask.Response` object with it. The response mimetype
        will be "application/json" and can be changed with
        :attr:`mimetype`.

        If :attr:`compact` is ``False`` or debug mode is enabled, the
        output will be formatted to be easier to read.

        Either positional or keyword arguments can be given, not both.
        If no arguments are given, ``None`` is serialized.

        :param args: A single value to serialize, or multiple values to
            treat as a list to serialize.
        :param kwargs: Treat as a dict to serialize.
        �JSONIFY_PRETTYPRINT_REGULAR�JSONIFY_MIMETYPENrz|The 'JSONIFY_PRETTYPRINT_REGULAR' config key is deprecated and will be removed in Flask 2.3. Set 'app.json.compact' instead.F�indentr�
separators)�,�:zrThe 'JSONIFY_MIMETYPE' config key is deprecated and will be removed in Flask 2.3. Set 'app.json.mimetype' instead.�
r7)r4rrdr_r`rarT�debugrbr8r9r)	rr-rr�	dump_args�prettyr8r_rTs	         rr:zDefaultJSONProvider.responsesC�� �(�(��v�6�6��(*�	���!�"?�@���9�#�$6�7�����O�O�O��M�M�/�#�	
�
�
�(.�:�G�G��l�G��O��	��O�G�u�4D�4D�� � ��1�-�-�-�-�� � ��z�:�:�:����O�O�O��M�M��#�	
�
�
�
��}�H��y�'�'��t�z�#�+�+��+�+�/�/�/�(�(�
�
�	
rr;r<r=)r>r?r@rA�staticmethodrPrS�__annotations__rYrZrTr8rr(r:rBrrrRrR}s����������+7�,��+�+�G������
�L��
�I�� �G������
"�H�/�=)�=)�=)�=)�~'�'�'�'�25
�5
�5
�5
�5
�5
rrR)rCrr
r)�
__future__rrKrGre�typing�trIr�datetimer�
werkzeug.httpr�globalsr�
TYPE_CHECKINGrr�wrappersr	rrPrRrBrr�<module>r~sF��"�"�"�"�"�"�������������������������������#�#�#�#�#�#��������?�$�������#�#�#�#�#�#�VV�VV�VV�VV�VV�VV�VV�VV�r
S�
S�
S�
S� y
�y
�y
�y
�y
�,�y
�y
�y
�y
�y
r

Youez - 2016 - github.com/yon3zu
LinuXploit