/usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__
Edit: /usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__/sftp.cpython-36.pyc (6104B)
3
8%EgY @ s~ d dl Z d dlZd dlZd dlZd dlmZmZ d dlZddlm Z ddl
mZ ejdZ
G dd de Zd d
Zdd ZdS )
N)S_ISDIRS_ISLNK )AbstractFileSystem)infer_storage_optionszfsspec.sftpc s e Zd ZdZd&Z fddZdd Zedd Ze d
d Z
d'd
dZd(ddZdd Z
dd Ze d)ddZd*ddZd+ddZd,ddZd-d d!Zd"d# Zd$d% Z ZS ).SFTPFileSystemzFiles over SFTP/SSH
Peer-to-peer filesystem over SSH using paramiko.
Note: if using this with the ``open`` or ``open_files``, with full URLs,
there is no way to tell if a path is relative, so all paths are assumed
to be absolute.
sftpsshc sB | j r
dS tt| jf | |jdd| _|| _|| _| j dS )a
Parameters
----------
host: str
Hostname or IP as a string
temppath: str
Location on the server to put files, when within a transaction
ssh_kwargs: dict
Parameters passed on to connection. See details in
http://docs.paramiko.org/en/2.4/api/client.html#paramiko.client.SSHClient.connect
May include port, username, password...
Ntemppathz/tmp) _cachedsuperr __init__popr
host
ssh_kwargs_connect)selfr r ) __class__ E/usr/local/lib/python3.6/site-packages/fsspec/implementations/sftp.pyr
s zSFTPFileSystem.__init__c C sN t jd| j tj | _| jjtj | jj| jf| j | jj
| _d S )NzConnecting to SFTP server %s)loggerdebugr paramikoZ SSHClientclientZset_missing_host_key_policyZ
AutoAddPolicyconnectr Z open_sftpftp)r r r r r 1 s
zSFTPFileSystem._connectc C s t |d S )Npath)r )clsr r r r _strip_protocol8 s zSFTPFileSystem._strip_protocolc C s$ t | }|jdd |jdd |S )Nr protocol)r r )Zurlpathoutr r r _get_kwargs_from_urls<