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__/info.cpython-312.pyc
�

��ob�4��T�dZddlmZmZmZddlZddlmZddlZddlm	Z	ddl
mZmZddl
mZdd	lmZdd
lmZddlmZddlmZej.r<dd
lmZmZmZmZmZmZddlmZeeeeeffZ ee!gefZ"ejFd�Z$ejJGd�de��Z&y)z0Container for filesystem resource informations.
�)�absolute_import�print_function�unicode_literalsN)�cast)�deepcopy�)�Text�overload)�ResourceType)�MissingInfoNamespace)�join)�Permissions)�epoch_to_datetime)�Any�Callable�List�Mapping�Optional�Union)�datetime�Tc���eZdZdZgd�Zefd�Zd�ZeZd�Z	e
d��Ze
d��Zd�Ze
d	��Ze
d
��Zd%d�Zd
�Z
d�Zd�Zd%d�Zd�Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Z ed ��Z!ed!��Z"ed"��Z#ed#��Z$ed$��Z%y)&�Infoa�Container for :ref:`info`.

    Resource information is returned by the following methods:

         * `~fs.base.FS.getinfo`
         * `~fs.base.FS.scandir`
         * `~fs.base.FS.filterdir`

    Arguments:
        raw_info (dict): A dict containing resource info.
        to_datetime (callable): A callable that converts an
            epoch time to a datetime object. The default uses
            `~fs.time.epoch_to_datetime`.

    )�raw�_to_datetime�
namespacesc�p�||_||_t|jj��|_y)z3Create a resource info object from a raw info dict.N)rr�	frozenset�keysr)�self�raw_info�to_datetimes   �)/usr/lib/python3/dist-packages/fs/info.py�__init__z
Info.__init__1s)�����'���#�D�H�H�M�M�O�4���c��|jrdj|j�Sdj|j�S)Nz
<dir '{}'>z<file '{}'>)�is_dir�format�name�r s r#�__str__zInfo.__str__8s3���;�;��&�&�t�y�y�1�1� �'�'��	�	�2�2r%c�6�|jt|dd�k(S)Nr)r�getattr)r �others  r#�__eq__zInfo.__eq__As���x�x�7�5�%��6�6�6r%c��y�N��r �ts  r#�_make_datetimezInfo._make_datetimeE���	
r%c��yr1r2r3s  r#r5zInfo._make_datetimeJr6r%c�*�|�|j|�Syr1)rr3s  r#r5zInfo._make_datetimeOs���=��$�$�Q�'�'�r%c��yr1r2)r �	namespace�keys   r#�getzInfo.getVr6r%c��yr1r2�r r:r;�defaults    r#r<zInfo.get[r6r%Nc�d�	|j|j||�S#t$r|cYSwxYw)a�Get a raw info value.

        Arguments:
            namespace (str): A namespace identifier.
            key (str): A key within the namespace.
            default (object, optional): A default value to return
                if either the namespace or the key within the namespace
                is not found.

        Example:
            >>> info = my_fs.getinfo("foo.py", namespaces=["details"])
            >>> info.get('details', 'type')
            2

        )rr<�KeyErrorr>s    r#r<zInfo.get`s7��"	��8�8�I�&�*�*�3��8�8���	��N�	�s�!�/�/c�6�||jvrt|��y)z�Check if the given namespace is present in the info.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the given namespace is not
                present in the info.

        N)rr�r r:s  r#�_require_namespacezInfo._require_namespacevs ���D�H�H�$�&�y�1�1�%r%c�0�|j|dd�}||vS)a�Check if a given key in a namespace is writable.

        When creating an `Info` object, you can add a ``_write`` key to
        each raw namespace that lists which keys are writable or not.

        In general, this means they are compatible with the `setinfo`
        function of filesystem objects.

        Arguments:
            namespace (str): A namespace identifier.
            key (str): A key within the namespace.

        Returns:
            bool: `True` if the key can be modified, `False` otherwise.

        Example:
            Create an `Info` object that marks only the ``modified`` key
            as writable in the ``details`` namespace::

                >>> now = time.time()
                >>> info = Info({
                ...     "basic": {"name": "foo", "is_dir": False},
                ...     "details": {
                ...         "modified": now,
                ...         "created": now,
                ...         "_write": ["modified"],
                ...     }
                ... })
                >>> info.is_writeable("details", "created")
                False
                >>> info.is_writeable("details", "modified")
                True

        �_writer2)r<)r r:r;�
_writeables    r#�is_writeablezInfo.is_writeable�s"��H�X�X�i��2�6�
��j� � r%c��||jvS)z�Check if the resource info contains a given namespace.

        Arguments:
            namespace (str): A namespace identifier.

        Returns:
            bool: `True` if the namespace was found, `False` otherwise.

        )rrCs  r#�
has_namespacezInfo.has_namespace�s���D�H�H�$�$r%c�^�tt|j�|xs|j��S)z+Create a copy of this resource info object.)r")rrrr)r r"s  r#�copyz	Info.copy�s%���H�T�X�X�&�K�4T�4�CT�CT�U�Ur%c�.�t||j�S)z�Make a path by joining ``dir_path`` with the resource name.

        Arguments:
            dir_path (str): A path to a directory.

        Returns:
            str: A path to the resource.

        )r
r))r �dir_paths  r#�	make_pathzInfo.make_path�s���H�d�i�i�(�(r%c�B�tt|jdd��S)z`str`: the resource name.�basicr))rr	r<r*s r#r)z	Info.name�s���D�$�(�(�7�F�3�4�4r%c��|jdd�}|jd�r|jd�dk(ry|jd�\}}}|rd|zSdS)aE`str`: the last component of the name (with dot).

        In case there is no suffix, an empty string is returned.

        Example:
            >>> info = my_fs.getinfo("foo.py")
            >>> info.suffix
            '.py'
            >>> info2 = my_fs.getinfo("bar")
            >>> info2.suffix
            ''

        rQr)�.r�)r<�
startswith�count�
rpartition)r r)�basename�dot�exts     r#�suffixzInfo.suffix�sX�� �x�x���(���?�?�3��D�J�J�s�O�q�$8��!�_�_�S�1���#�s��s�S�y�'�R�'r%c���|jdd�}|jd�r|jd�dk(rgS|jd�ddD�cgc]}d|z��	c}Scc}w)z�`List`: a list of any suffixes in the name.

        Example:
            >>> info = my_fs.getinfo("foo.tar.gz")
            >>> info.suffixes
            ['.tar', '.gz']

        rQr)rSrN)r<rUrV�split)r r)r[s   r#�suffixesz
Info.suffixes�s[���x�x���(���?�?�3��D�J�J�s�O�q�$8��I�+/�:�:�c�?�1�2�+>�?���f��?�?��?s�Ac�t�|jdd�}|jd�r|S|jd�dS)z�`str`: the name minus any suffixes.

        Example:
            >>> info = my_fs.getinfo("foo.tar.gz")
            >>> info.stem
            'foo'

        rQr)rSr)r<rUr])r r)s  r#�stemz	Info.stem�s8���x�x���(���?�?�3���K��z�z�#��q�!�!r%c�B�tt|jdd��S)z6`bool`: `True` if the resource references a directory.rQr'�r�boolr<r*s r#r'zInfo.is_dirs���D�$�(�(�7�H�5�6�6r%c�D�tt|jdd��S)z1`bool`: `True` if the resource references a file.rQr'rbr*s r#�is_filezInfo.is_file
s����d�h�h�w��9�:�:�:r%c�N�|jd�|jddd�duS)z,`bool`: `True` if the resource is a symlink.�link�targetN�rDr<r*s r#�is_linkzInfo.is_links*��	
����'��x�x���$�/�t�;�;r%c�\�|jd�t|jddd��S)z�`~fs.enums.ResourceType`: the type of the resource.

        Requires the ``"details"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the 'details'
                namespace is not in the Info.

        �details�typer)rDrr<r*s r#rmz	Info.types*��	
���	�*��D�H�H�Y���:�;�;r%c�j�|jd�|j|jdd��}|S)z�`~datetime.datetime`: the resource last access time, or `None`.

        Requires the ``"details"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"details"``
                namespace is not in the Info.

        rl�accessed�rDr5r<�r �_times  r#roz
Info.accessed&�2��	
���	�*��#�#�D�H�H�Y�
�$C�D���r%c�j�|jd�|j|jdd��}|S)z�`~datetime.datetime`: the resource last modification time, or `None`.

        Requires the ``"details"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"details"``
                namespace is not in the Info.

        rl�modifiedrprqs  r#ruz
Info.modified6rsr%c�j�|jd�|j|jdd��}|S)z�`~datetime.datetime`: the resource creation time, or `None`.

        Requires the ``"details"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"details"``
                namespace is not in the Info.

        rl�createdrprqs  r#rwzInfo.createdFs2��	
���	�*��#�#�D�H�H�Y�	�$B�C���r%c�j�|jd�|j|jdd��}|S)z�`~datetime.datetime`: the resource metadata change time, or `None`.

        Requires the ``"details"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"details"``
                namespace is not in the Info.

        rl�metadata_changedrprqs  r#ryzInfo.metadata_changedVs3��	
���	�*��#�#�D�H�H�Y�8J�$K�L���r%c�h�|jd�|jdd�}|�yt|�}|S)z�`Permissions`: the permissions of the resource, or `None`.

        Requires the ``"access"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"access"``
                namespace is not in the Info.

        �access�permissionsN)rDr<r)r �_perm_namesr|s   r#r|zInfo.permissionsfs;��	
����)��h�h�x��7�����!�+�.���r%c�d�|jd�tt|jdd��S)z�`int`: the size of the resource, in bytes.

        Requires the ``"details"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"details"``
                namespace is not in the Info.

        rl�size)rDr�intr<r*s r#rz	Info.sizeys*��	
���	�*��C����)�V�4�5�5r%c�H�|jd�|jdd�S)z�`str`: the owner of the resource, or `None`.

        Requires the ``"access"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"access"``
                namespace is not in the Info.

        r{�userrir*s r#r�z	Info.user�s#��	
����)��x�x��&�)�)r%c�H�|jd�|jdd�S)z�`int`: the user id of the resource, or `None`.

        Requires the ``"access"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"access"``
                namespace is not in the Info.

        r{�uidrir*s r#r�zInfo.uid��#��	
����)��x�x��%�(�(r%c�H�|jd�|jdd�S)z�`str`: the group of the resource owner, or `None`.

        Requires the ``"access"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"access"``
                namespace is not in the Info.

        r{�grouprir*s r#r�z
Info.group�s#��	
����)��x�x��'�*�*r%c�H�|jd�|jdd�S)z�`int`: the group id of the resource, or `None`.

        Requires the ``"access"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"access"``
                namespace is not in the Info.

        r{�gidrir*s r#r�zInfo.gid�r�r%c�H�|jd�|jdd�S)z�`str`: the link target (if resource is a symlink), or `None`.

        Requires the ``"link"`` namespace.

        Raises:
            ~fs.errors.MissingInfoNamespace: if the ``"link"``
                namespace is not in the Info.

        rgrhrir*s r#rhzInfo.target�s#��	
����'��x�x���)�)r%r1)&�__name__�
__module__�__qualname__�__doc__�	__slots__rr$r+�__repr__r/r
r5r<rDrHrJrLrO�propertyr)r[r^r`r'rerjrmrorurwryr|rr�r�r�r�rhr2r%r#rrs��� 6�I�->�5�3��H�7��
��
��
��
���
��
��
��
��,
2�%!�N%�V�
)��5��5�
�(��(�*�
@��
@��
"��
"��7��7�
�;��;�
�<��<��<��<��
��
��
��
��
��
��
��
�����$�6��6��*��*��)��)��+��+��)��)��*��*r%r)'r��
__future__rrr�typingr�sixrLr�_typingr	r
�enumsr�errorsr�pathr
r|r�timer�
TYPE_CHECKINGrrrrrrr�object�RawInfor��
ToDatetime�TypeVarr�python_2_unicode_compatiblerr2r%r#�<module>r�s����I�H�
��
��#��(��$�#�	���D�D�!��d�G�D�&�L�1�1�2�G��3�%��/�*�J�����s��A�� � �s*�6�s*�!�s*r%

Youez - 2016 - github.com/yon3zu
LinuXploit