/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__/ftp.cpython-36.pyc (10444B)
3 8%Eg)@sddlZddlmZmZmZddlmZddlmZm Z ddl m Z Gddde Z Gd d d e ZGd d d eZdddZdS)N)FTPError error_perm)Any)AbstractBufferedFileAbstractFileSystem)infer_storage_optionscseZdZdZdZdZdZd.fdd Zd d Ze d d Z e ddZ d/ddZ ddZddZd0fdd Zd1ddZddZd2ddZd3eeedd d!d"Zd4eedd#d$d%Zd&d'Zd(d)Zd*d+Zd5fd,d- ZZS)6 FTPFileSystemzA filesystem over classic FTP/FftpNc  s\tt|jf| ||_||_|p$d|_|||f|_||_|dk rJ||_nd|_|j dS)ae You can use _get_kwargs_from_urls to get some kwargs from a reasonable FTP url. Authentication will be anonymous if username/password are not given. Parameters ---------- host: str The remote server name/ip to connect to port: int Port to connect with username: str or None If authenticating, the user's identifier password: str of None User's password on the server, if using acct: str or None Some servers also need an "account" string for auth block_size: int or None If given, the read-ahead or write buffer size. tempdir: str Directory on remote to put temporary files when in a transaction timeout: int Timeout of the ftp connection in seconds z/tmpNri) superr __init__hostporttempdircredtimeout blocksize_connect) selfrrusernamepasswordZacct block_sizerrkwargs) __class__D/usr/local/lib/python3.6/site-packages/fsspec/implementations/ftp.pyrs&  zFTPFileSystem.__init__cCs2t|jd|_|jj|j|j|jj|jdS)N)r)rrr connectrrloginr)rrrr rBszFTPFileSystem._connectcCsdt|djdjdS)Nr path)r lstriprstrip)clsr#rrr _strip_protocolGszFTPFileSystem._strip_protocolcCs$t|}|jdd|jdd|S)Nr#protocol)r pop)Zurlpathoutrrr _get_kwargs_from_urlsKs  z#FTPFileSystem._get_kwargs_from_urlsTc Ksf|j|}g}||jkr2yydd|jj|D}Wn tk rVt|j|}YnXxn|D]f\}}|dkrrd}dj||jdg|d<|ddkrt|d|d<nd |d<|dd kr^d |d<q^W||j|<Wn\t k r0y&|j |}|ddkr ||fg}Wnt t fk r*t YnXYnX|jj ||}|sXtd d|DSd d|DS)NcSs,g|]$\}}|dkr|ddkr||fqS)...typepdircdir)r,r-)r/r0r).0fndetailsrrr Ysz$FTPFileSystem.ls..r namer.filesizerdir directorycSsg|] \}}|qSrr)r1r2r3rrr r4tscSsg|] \}}|qSrr)r1r2r3rrr r4us)r'dircacher Zmlsdr_mlsd2joinr$intrinfo IndexErrorFileNotFoundErrorgetsorted) rr#Zdetailrr*r2r3r?filesrrr lsRs<      zFTPFileSystem.lsc sr|jdkrddddS|j|jjdd}yfdd|Dd}Wntk rltYnX|S)Nr rr:)r6r8r.Tcsg|]}|dkr|qS)r6r)r1f)r#rr r4sz&FTPFileSystem.info..)r'rE_parentr$r@rA)rr#rrDr*r)r#r r?ws  zFTPFileSystem.infoc s>t|d*fdd}|jjd||j|dWdQRXdS)Nwbcsj|dS)N)write)x)outfilerr cbsz"FTPFileSystem.get_file..cbzRETR %s)rcallback)openr retrbinaryr)rZrpathZlpathrrLr)rKr get_files   zFTPFileSystem.get_filec sP|dk rtj|||f|Sgfdd}|jjd||j||ddjS)Ncsj|dS)N)append)rJ)r*rr rLsz"FTPFileSystem.cat_file..cbzRETR %s)rrestrM)rcat_filer rOrr=)rr#startendrrL)r)r*r rTs zFTPFileSystem.cat_filerbc Ks,|j|}|p|j}t|||||j||dS)N)moderr autocommit cache_options)r'rFTPFiler)rr#rXrrZrYrrrr _opens  zFTPFileSystem._opencCs*|j|}|jj||j|j|dS)N)r'r deleteinvalidate_cacherG)rr#rrr _rms  zFTPFileSystem._rmcCsF|j|||d}x0t|D]$}|j|r4|j|q|j|qWdS)N) recursivemaxdepth)Z expand_pathreversedisfileZrm_filermdir)rr#r`rapathsprrr rms   zFTPFileSystem.rm)r#create_parentsrreturncKs\|j|}|j|}||jkr<|j| r<|r<|j||d|jj||j|j|dS)N)rh)r'rG root_markerexistsmkdirr Zmkdr^)rr#rhrparentrrr rls    zFTPFileSystem.mkdir)r#exist_okricCs:|j|}|j|r(|s6t|dn|j|dddS)Nz exists without `exist_ok`T)rh)r'rkFileExistsErrorrl)rr#rnrrr makedirss   zFTPFileSystem.makedirscCs*|j|}|jj||j|j|dS)N)r'r Zrmdr^rG)rr#rrr rds  zFTPFileSystem.rmdircKsF|j|}|j|}|jj|||j|j||j|j|dS)N)r'r renamer^rG)rZpath1Zpath2rrrr mvs   zFTPFileSystem.mvcCs|jjdS)N)r close)rrrr __del__szFTPFileSystem.__del__cs6|dkr|jjn|jj|dtt|j|dS)N)r;clearr)rr r^)rr#)rrr r^s zFTPFileSystem.invalidate_cache)r NNNNNr)T)NN)rWNNT)FN)T)F)N)__name__ __module__ __qualname____doc__rjZcachabler(rr classmethodr' staticmethodr+rEr?rPrTr\r_rgstrboolrrlrprdrrrtr^ __classcell__rr)rr r s<)   %      r c@seZdZdZdS) TransferDonez+Internal exception to break out of transferN)rvrwrxryrrrr rsrcsDeZdZdZdfdd Zd d Zd d Zd dZdddZZ S)r[z9Interact with a remote FTP file with read/write bufferingrWdefaultT readaheadNc  sNtj||f|||||d||sJ|j|_dj|dttjg|_dS)N)rXrrY cache_typerZr r)rrr#targetr=r|uuiduuid4) rfsr#rXrrYrrZr)rrr rs zFTPFile.__init__cCs|jj|j|jdS)N)rrrr#r)rrrr commitszFTPFile.commitcCs|jj|jdS)N)rrgr#)rrrr discardszFTPFile.discardcsgdgfdd}y"jjjdjj|dWnPtk ryjjjjjjWntk rjj YnXYnXdj S)aGet bytes between given byte limits Implemented by raising an exception in the fetch callback when the number of bytes received reaches the requested amount. Will fail if the server does not respect the REST command on retrieve requests. rcs~dt|7<dkrRj|ddjkr\tn j|dkrzjkrztdS)Nr)lenrQr8r)rJ)rVr*rrUtotalrr rM s  z&FTPFile._fetch_range..callbackzRETR %s)rrRrMrS) rr rOr#rrabortZ getmultilinerrr=)rrUrVrMr)rVr*rrUrr _fetch_ranges    zFTPFile._fetch_rangeFcCs2|jjd|jjjd|j|j|j|jddS)NrzSTOR )rrRT)bufferseekrr Z storbinaryr#roffset)rfinalrrr _upload_chunk=s zFTPFile._upload_chunk)rWrTrN)F) rvrwrxryrrrrrr~rr)rr r[s)r[r,cCsg}g}|j||jx|D]z}|j}|ddj|dd|d|d|d|dd f}d |dd dkrd |dd <n d|dd <|j|qW|S)a( Fall back to using `dir` instead of `mlsd` if not supported. This parses a Linux style `ls -l` response to `dir`, but the response may be platform dependent. Parameters ---------- ftp: ftplib.FTP path: str Expects to be given path, but defaults to ".".  rr)modifyz unix.ownerz unix.groupz unix.moder8dz unix.moder9r.r7)r9rQsplitr=)r r#linesZminfolinethisrrr r<Es   r<)r,)rftplibrrrtypingrspecrrutilsr r Exceptionrr[r<rrrr s  dS