403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
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-310.pyc
o

�Q`�0�@sdZddlmZddlmZddlmZddlZddlmZddlmZddl	Z	dd	l
mZdd
lm
Z
ddlmZddlmZdd
lmZddlmZmZejr}ddlmZddlmZmZmZmZmZmZeeeeeffZ ee!gefZ"e�#d�Z$e	j%Gdd�de��Z&dS)z0Container for filesystem resource informations.
�)�absolute_import)�print_function)�unicode_literalsN)�cast)�deepcopy�)�join)�ResourceType)�MissingInfoNamespace)�Permissions)�epoch_to_datetime)�overload�Text)�datetime)�Any�Callable�List�Mapping�Optional�Union�Tc@s�eZdZdZgd�Zefdd�Zdd�ZeZdd�Z	e
d	d
��Ze
dd
��Zdd
�Ze
d
d��Ze
dd��ZdBdd�Zdd�Z
dd�Zdd�ZdBdd�Zdd�Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zed2d3��Zed4d5��Zed6d7��Z ed8d9��Z!ed:d;��Z"ed<d=��Z#ed>d?��Z$ed@dA��Z%dS)C�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
            :func:`~fs.time.epoch_to_datetime`.

    )�raw�_to_datetime�
namespacescCs ||_||_t|j���|_dS)z<Create a resource info object from a raw info dict.
        N)rr�	frozenset�keysr)�self�raw_info�to_datetime�r �)/usr/lib/python3/dist-packages/fs/info.py�__init__2sz
Info.__init__cCs|jr	d�|j�Sd�|j�S)Nz
<dir '{}'>z<file '{}'>)�is_dir�format�name�rr r r!�__str__:szInfo.__str__cCs|jt|dd�kS)Nr)r�getattr)r�otherr r r!�__eq__CszInfo.__eq__cC�dS�Nr �r�tr r r!�_make_datetimeG�zInfo._make_datetimecCr+r,r r-r r r!r/Lr0cCs|dur	|�|�SdSr,)rr-r r r!r/Qs
cCr+r,r )r�	namespace�keyr r r!�getXr0zInfo.getcCr+r,r �rr1r2�defaultr r r!r3]r0NcCs,z
|j|�||�WSty|YSw)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.get('access', 'permissions')
            ['u_r', 'u_w', '_wx']

        )rr3�KeyErrorr4r r r!r3bs
�cCs||jvr	t|��dS)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
�rr1r r r!�_require_namespacews
	�zInfo._require_namespacecCs|�|dd�}||vS)a5Check if a given key in a namespace is writable.

        Uses `~fs.base.FS.setinfo`.

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

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

        �_writer )r3)rr1r2�
_writeabler r r!�is_writeable�szInfo.is_writeablecCs
||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.

        )rr7r r r!�
has_namespace�s
zInfo.has_namespacecCstt|j�|p	|jd�S)z4Create a copy of this resource info object.
        )r)rrrr)rrr r r!�copy�sz	Info.copycCs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.

        )rr%)r�dir_pathr r r!�	make_path�szInfo.make_pathcC�tt|�dd��S)z"`str`: the resource name.
        �basicr%)rrr3r&r r r!r%��z	Info.namecCsH|�dd�}|�d�r|�d�dkrdS|�d�\}}}|r"d|SdS)z�`str`: the last component of the name (including dot), or an
        empty string if there is no suffix.

        Example:
            >>> info
            <info 'foo.py'>
            >>> info.suffix
            '.py'
        rAr%�.r�)r3�
startswith�count�
rpartition)rr%�basename�dot�extr r r!�suffix�s
zInfo.suffixcCsD|�dd�}|�d�r|�d�dkrgSdd�|�d�dd�D�S)z�`List`: a list of any suffixes in the name.

        Example:
            >>> info
            <info 'foo.tar.gz'>
            >>> info.suffixes
            ['.tar', '.gz']
        rAr%rCrcSsg|]}d|�qS)rCr )�.0rKr r r!�
<listcomp>�sz!Info.suffixes.<locals>.<listcomp>N)r3rErF�split�rr%r r r!�suffixes�sz
Info.suffixescCs(|�dd�}|�d�r
|S|�d�dS)z�`str`: the name minus any suffixes.

        Example:
            >>> info
            <info 'foo.tar.gz'>
            >>> info.stem
            'foo'

        rAr%rCr)r3rErNrOr r r!�stem�s
z	Info.stemcCr@)z?`bool`: `True` if the resource references a directory.
        rAr#�r�boolr3r&r r r!r#�rBzInfo.is_dircCstt|�dd��S)z:`bool`: `True` if the resource references a file.
        rAr#rRr&r r r!�is_file�szInfo.is_filecCs|�d�|�ddd�duS)z5`bool`: `True` if the resource is a symlink.
        �link�targetN�r8r3r&r r r!�is_link�s
zInfo.is_linkcCs|�d�t|�ddd��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)r8r	r3r&r r r!rZ�
z	Info.typecC� |�d�|�|�dd��}|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.

        rY�accessed�r8r/r3�r�_timer r r!r]�
z
Info.accessedcCr\)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.

        rY�modifiedr^r_r r r!rb#raz
Info.modifiedcCr\)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.

        rY�createdr^r_r r r!rc3razInfo.createdcCr\)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.

        rY�metadata_changedr^r_r r r!rdCrazInfo.metadata_changedcCs.|�d�|�dd�}|durdSt|�}|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)r8r3r)r�_perm_namesrfr r r!rfSs
zInfo.permissionscCs|�d�tt|�dd��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.

        rY�size)r8r�intr3r&r r r!rhfr[z	Info.sizecC�|�d�|�dd�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.

        re�userrWr&r r r!rku�
z	Info.usercCrj)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.

        re�uidrWr&r r r!rm�rlzInfo.uidcCrj)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.

        re�grouprWr&r r r!rn�rlz
Info.groupcCrj)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.

        re�gidrWr&r r r!ro�rlzInfo.gidcCrj)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.

        rUrVrWr&r r r!rV�rlzInfo.targetr,)&�__name__�
__module__�__qualname__�__doc__�	__slots__rr"r'�__repr__r*r
r/r3r8r;r<r=r?�propertyr%rKrPrQr#rTrXrZr]rbrcrdrfrhrkrmrnrorVr r r r!rsx
























r)'rs�
__future__rrr�typingrr=r�six�pathr�enumsr	�errorsr
rfr�timer�_typingr
r�
TYPE_CHECKINGrrrrrrr�object�RawInfori�
ToDatetime�TypeVarr�python_2_unicode_compatiblerr r r r!�<module>s, 


Youez - 2016 - github.com/yon3zu
LinuXploit