%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/paramiko/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/paramiko/__pycache__/sftp_attr.cpython-312.pyc

�

�ec� ��V�ddlZddlZddlmZmZmZmZddlmZm	Z	m
Z
Gd�de�Zy)�N)�	x80000000�o700�o70�	xffffffff)�long�PY2�strftimec��eZdZdZdZdZdZdZeZ	d�Z
edd��Zd	�Z
edd
��Zd�Zd�Zd
�Zedd��Zd�Zd�ZereZeZyeZy)�SFTPAttributesah
    Representation of the attributes of a file (or proxied file) for SFTP in
    client or server mode.  It attemps to mirror the object returned by
    `os.stat` as closely as possible, so it may have the following fields,
    with the same meanings as those returned by an `os.stat` object:

        - ``st_size``
        - ``st_uid``
        - ``st_gid``
        - ``st_mode``
        - ``st_atime``
        - ``st_mtime``

    Because SFTP allows flags to have other arbitrary named attributes, these
    are stored in a dict named ``attr``.  Occasionally, the filename is also
    stored, in ``filename``.
    ����c�t�d|_d|_d|_d|_d|_d|_d|_i|_y)zX
        Create a new (empty) SFTPAttributes object.  All fields will be empty.
        rN)�_flags�st_size�st_uid�st_gid�st_mode�st_atime�st_mtime�attr��selfs �4/usr/lib/python3/dist-packages/paramiko/sftp_attr.py�__init__zSFTPAttributes.__init__2s<�������������������
���
���	�Nc���|�}|j|_|j|_|j|_|j|_|j|_|j
|_|�||_|S)a`
        Create an `.SFTPAttributes` object from an existing ``stat`` object (an
        object returned by `os.stat`).

        :param object obj: an object returned by `os.stat` (or equivalent).
        :param str filename: the filename associated with this file.
        :return: new `.SFTPAttributes` object with the same attribute fields.
        )rrrrrr�filename)�cls�objrrs    r�	from_statzSFTPAttributes.from_stat?s_���u���{�{����j�j����j�j����{�{�������
�����
���$�D�M��rc�@�dj|j��S)Nz<SFTPAttributes: {}>)�format�
_debug_strrs r�__repr__zSFTPAttributes.__repr__Ts��%�,�,�T�_�_�->�?�?rc�Z�|�}|j|�|�||_|�||_|S�N)�_unpackr�longname)r �msgrr*rs     r�	_from_msgzSFTPAttributes._from_msgXs4���u�����S����$�D�M���$�D�M��rc��|j�|_|j|jzr|j�|_|j|j
zr*|j�|_|j�|_|j|jzr|j�|_	|j|jzr*|j�|_|j�|_|j|jzrL|j�}t|�D]-}|j�|j |j�<�/yyr()�get_intr�	FLAG_SIZE�	get_int64r�FLAG_UIDGIDrr�FLAG_PERMISSIONSr�FLAG_AMTIMErr�
FLAG_EXTENDED�range�
get_stringr)rr+�count�is    rr)zSFTPAttributes._unpackbs����k�k�m����;�;����'��=�=�?�D�L��;�;��)�)�)��+�+�-�D�K��+�+�-�D�K��;�;��.�.�.��;�;�=�D�L��;�;��)�)�)��K�K�M�D�M��K�K�M�D�M��;�;��+�+�+��K�K�M�E��5�\�
?��.1�n�n�.>��	�	�#�.�.�*�+�
?�,rc�p�d|_|j�|xj|jzc_|j�+|j�|xj|j
zc_|j�|xj|jzc_|j�+|j�|xj|jzc_t|j�dkDr|xj|jzc_|j|j�|j|jzr|j|j�|j|j
zr6|j|j�|j|j�|j|jzr|j|j�|j|jzrH|jt!|j��|jt!|j��|j|jzrh|jt|j��|jj#�D]'\}}|j%|�|j%|��)y)Nr)rrr/rrr1rr2rrr3�lenrr4�add_int�	add_int64r�items�
add_string)rr+�key�vals    r�_packzSFTPAttributes._packss�������<�<�#��K�K�4�>�>�)�K��K�K�#�$�+�+�*A��K�K�4�+�+�+�K��<�<�#��K�K�4�0�0�0�K��M�M�%�D�M�M�,E��K�K�4�+�+�+�K��t�y�y�>�A���K�K�4�-�-�-�K����D�K�K� ��;�;����'��M�M�$�,�,�'��;�;��)�)�)��K�K����$��K�K����$��;�;��.�.�.��K�K����%��;�;��)�)�)��K�K��T�]�]�+�,��K�K��T�]�]�+�,��;�;��+�+�+��K�K��D�I�I��'� �I�I�O�O�-�
$���S����s�#����s�#�
$�	rc�@�d}|j�|dj|j�z
}|j�5|j�)|dj|j|j�z
}|j�|dt|j�zdzz
}|j�5|j�)|dj|j|j�z
}|jj�D]#\}}|djt|�|�z
}�%|dz
}|S)	Nz[ zsize={} zuid={} gid={} zmode=� zatime={} mtime={} z
"{}"={!r} �])rr$rrr�octrrrr=�str)r�out�k�vs    rr%zSFTPAttributes._debug_str�s������<�<�#��:�$�$�T�\�\�2�2�C��K�K�#�$�+�+�*A��#�*�*�4�;�;����D�D�C��<�<�#��7�S����.�.��4�4�C��M�M�%�D�M�M�,E��'�.�.�t�}�}�d�m�m�L�L�C��I�I�O�O�%�	2�D�A�q��<�&�&�s�1�v�q�1�1�C�	2��s�
���
rc�v�|rd}d|dz	d|dz	dzz}|r|d||dzzz
}|S|d||dzzz
}|S)Nr
z-rz-wrz-xTtz-xSs�)�n�suid�stickyrGs    r�_rwxzSFTPAttributes._rwx�sh����D��1��6�l�T�1��6�Q�,�/�/����6�$�!�a�%�.�)�)�C��
�
�6�$�!�a�%�.�)�)�C��
rc���|j���tj|j�}|tjk(rd}n�|tjk(rd}np|tj
k(rd}nZ|tjk(rd}nD|tjk(rd}n.|tjk(rd}n|tjk(rd}nd}||j|jtzd	z	|jtjz�z
}||j|jtzd
z	|jtjz�z
}||j|jdz|jtjzd�z
}nd
}|j �|j t"k(rd}net%j&|j �}t)t%j$�|j z
�dkDr
t+d|�}nt+d|�}t-|dd�}|j.}|j0}|j2}|�d}|�d}|�d}d||||||fzS)z=create a unix-style long description of the file (like ls -l)�p�c�d�b�-�l�s�?���Tz
?---------z(unknown date)iN�z%d %b %Yz%d %b %H:%Mrrz%s   1 %-8d %-8d %8d %-12s %s)r�stat�S_IFMT�S_IFIFO�S_IFCHR�S_IFDIR�S_IFBLK�S_IFREG�S_IFLNK�S_IFSOCKrOr�S_ISUIDr�S_ISGID�S_ISVTXrr�time�	localtime�absr	�getattrrrr)	r�kind�ks�datestr�
time_tupler�uid�gid�sizes	         r�_as_textzSFTPAttributes._as_text�s���<�<�#��;�;�t�|�|�,�D��t�|�|�#�������%�������%�������%�������%�������%�������&������$�)�)�����$��*�D�L�L�4�<�<�,G��
�B�
�$�)�)�����#��)�4�<�<�$�,�,�+F��
�B�
�$�)�)����q� �$�,�,����"=�t��
�B��B��M�M�!�t�}�}�	�'A�&�G�����
�
�6�J��4�9�9�;����.�/�(�:�"�:�z�:��"�=�*�=���4��S�1���k�k���k�k���|�|���;��C��;��C��<��D�
/�������
2
�
�	
rc�@�|j�jd�S)Nzutf-8)rs�encoders r�asbyteszSFTPAttributes.asbytes�s���}�}��%�%�g�.�.rr()NN)F)�__name__�
__module__�__qualname__�__doc__r/r1r2r3rr4r�classmethodr"r&r,r)rAr%�staticmethodrOrsrvr�__unicode__�__str__rKrrrrs����$�I��K����K��M������(@�����?�"�>
�����A
�F/�������rr)
r\rh�paramiko.commonrrrr�paramiko.py3compatrrr	�objectrrKrr�<module>r�s'��&��;�;�2�2�]�V�]r

Zerion Mini Shell 1.0