/usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__
NameSizeModeActions
arrow.cpython-36.pyc73280644editdlrm
cached.cpython-36.pyc230300644editdlrm
dask.cpython-36.pyc46560644editdlrm
dbfs.cpython-36.pyc133510644editdlrm
dvc.cpython-36.pyc26220644editdlrm
ftp.cpython-36.pyc104440644editdlrm
git.cpython-36.pyc37500644editdlrm
github.cpython-36.pyc74040644editdlrm
hdfs.cpython-36.pyc70930644editdlrm
http.cpython-36.pyc207520644editdlrm
jupyter.cpython-36.pyc41310644editdlrm
libarchive.cpython-36.pyc60050644editdlrm
local.cpython-36.pyc119120644editdlrm
memory.cpython-36.pyc66970644editdlrm
reference.cpython-36.pyc161420644editdlrm
sftp.cpython-36.pyc61040644editdlrm
smb.cpython-36.pyc105910644editdlrm
tar.cpython-36.pyc45020644editdlrm
webhdfs.cpython-36.pyc147120644editdlrm
zip.cpython-36.pyc32760644editdlrm
__init__.cpython-36.pyc1560644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__/sftp.cpython-36.pyc (6104B)
3 8%EgY@s~ddlZddlZddlZddlZddlmZmZddlZddlm Z ddl m Z ej dZ Gddde Zd d Zd d ZdS) N)S_ISDIRS_ISLNK)AbstractFileSystem)infer_storage_optionsz fsspec.sftpcseZdZdZd&ZfddZddZedd Ze d d Z d'd dZ d(ddZ ddZ ddZe d)ddZd*ddZd+ddZd,ddZd-d d!Zd"d#Zd$d%ZZS).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|jr dStt|jf||jdd|_||_||_|jdS)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)selfrr) __class__E/usr/local/lib/python3.6/site-packages/fsspec/implementations/sftp.pyr szSFTPFileSystem.__init__cCsNtjd|jtj|_|jjtj|jj|jf|j |jj |_ dS)NzConnecting to SFTP server %s) loggerdebugrparamikoZ SSHClientclientZset_missing_host_key_policyZ AutoAddPolicyconnectrZ open_sftpftp)rrrrr1s  zSFTPFileSystem._connectcCs t|dS)Npath)r)clsrrrr_strip_protocol8szSFTPFileSystem._strip_protocolcCs$t|}|jdd|jdd|S)Nrprotocol)rr)Zurlpathoutrrr_get_kwargs_from_urls<s  z$SFTPFileSystem._get_kwargs_from_urlscCs tjd||jj||dS)NzCreating folder %s)rrrmkdir)rrmoderrrr#CszSFTPFileSystem.mkdirFcCs`|j|r| rtdj||jd}d}x.|D]&}|d|7}|j|s2|j||q2WdS)NzFile exists: {}/)existsFileExistsErrorformatsplitr#)rrexist_okr$partspartrrrmakedirsGs    zSFTPFileSystem.makedirscCstjd||jj|dS)NzRemoving folder %s)rrrrmdir)rrrrrr/SszSFTPFileSystem.rmdircCs|j|jj|}||d<|S)Nname) _decode_statrstat)rrr2rrrinfoWszSFTPFileSystem.infoNcCstt|jrd}nt|jr d}nd}d|j||j|jtjj|jtjj|j d}|rpdj |j d|j g|d<|S)N directorylinkfiler&)r0sizetypeuidgidtimemtimer%r0) rst_moderst_sizest_uidst_giddatetimeutcfromtimestampst_atimest_mtimejoinrstripfilename)r2 parent_pathtr rrrr1\s   zSFTPFileSystem._decode_statcsLtjdfddjjD}|r2|Sdd|D}t|SdS)NzListing folder %scsg|]}j|qSr)r1).0r2)rrrr ssz%SFTPFileSystem.ls..cSsg|] }|dqS)r0r)rJr2rrrrKws)rrrZ listdir_itersorted)rrZdetailstatspathsr)rrrlsqs zSFTPFileSystem.lscKs$tjd||f|jj||dS)NzPut file %s into %s)rrrput)rlpathrpathcallbackkwargsrrrrPzszSFTPFileSystem.putcKs$tjd||f|jj||dS)NzGet file %s into %s)rrrget)rrRrQrSrTrrrrU~szSFTPFileSystem.getrbcKstjd||jdddkrdj|jttjg}|jj |||rH|ndd}||_||_ ||_ t j t||_t j t||_n|jj |||r|nd d}|S) z block_size: int or None If 0, no buffering, if 1, line buffering, if >1, buffer that many bytes, if None use default from paramiko. zOpening file %sZ autocommitTFr%)bufsizerY)rrrUrEr struuiduuid4ropen targetpathfstypes MethodType commit_a_filecommitdiscard_a_filediscard)rrr$ block_sizerTZpath2frrr_openszSFTPFileSystem._opencCs(|j|r|jj|n |jj|dS)N)isdirrr/remove)rrrrr_rms zSFTPFileSystem._rmcCs$tjd||f|jj||dS)NzRenaming %s into %s)rrrZ posix_rename)roldnewrrrmvszSFTPFileSystem.mv)rr )r")Fr")N)F)N)N)rVN)__name__ __module__ __qualname____doc__rr r classmethodr staticmethodr!r#r.r/r3r1rOrPrUrhrkrn __classcell__rr)rrrs$         rcCs|jj|j|jdS)N)r_rnr r^)rrrrrbsrbcCs|jj|jdS)N)r_rkr )rrrrrdsrd)rAloggingr`r[r2rrrr&rutilsr getLoggerrrrbrdrrrrs