|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/site-packages/pysftp/__pycache__/ |
U
P��g) � @ s� d Z ddlmZ ddlZddlZddlZddlmZmZm Z dd� Z
dd� ZG d d
� d
e�Z
ejfdd�Zejfd
d�Zdd� Zddd�Zeddd��ZdS )z8functions and classes that support the Connection object� )�contextmanagerN)�S_IMODE�S_ISDIR�S_ISREGc C s t j�t j�ddd��S )z:return a proper path to ssh's known_host file for the user�~z.ssh�known_hosts)�os�path�
expanduser�join� r r �;/opt/cppython/lib/python3.8/site-packages/pysftp/helpers.pyr
s r c C s t ttt| ���dd� �S )ay SFTAttributes st_mode returns an stat type that shows more than what
can be set. Trim off those bits and convert to an int representation.
if you want an object that was `chmod 711` to return a value of 711, use
this function
:param int val: the value of an st_mode attr returned by SFTPAttributes
:returns int: integer representation of octal mode
���N)�int�str�octr )�valr r r
�st_mode_to_int s r c @ s~ e Zd ZdZdd� Zdd� Zdd� Zdd � Zed
d� �Z e j
dd� �Z ed
d� �Zej
dd� �Zedd� �Zej
dd� �ZdS )�WTCallbacksz1an object to house the callbacks, used internallyc C s g | _ g | _g | _dS )zset instance varsN)�_flist�_dlist�_ulist��selfr r r
�__init__ s zWTCallbacks.__init__c C s | j �|� dS )zecalled for regular files, appends pathname to .flist
:param str pathname: file path
N)r �append�r �pathnamer r r
�file_cb% s zWTCallbacks.file_cbc C s | j �|� dS )zhcalled for directories, appends pathname to .dlist
:param str pathname: directory path
N)r r r r r r
�dir_cb, s zWTCallbacks.dir_cbc C s | j �|� dS )ztcalled for unknown file types, appends pathname to .ulist
:param str pathname: unknown entity path
N)r r r r r r
�unk_cb3 s zWTCallbacks.unk_cbc C s
t | j�S )z�return a sorted list of files currently traversed
:getter: returns the list
:setter: sets the list
:type: list
)�sortedr r r r r
�flist: s zWTCallbacks.flistc C s
|| _ dS )zsetter for _flist N)r �r r r r r
r"