/usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__
Edit: /usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__/ftp.cpython-36.pyc (10444B)
3
8%Eg) @ s d dl Z d dlmZmZmZ d dlmZ ddlmZm Z ddl
mZ G dd de ZG d d
d
e
ZG dd deZdddZdS ) N)FTPError
error_perm)Any )AbstractBufferedFileAbstractFileSystem)infer_storage_optionsc s e Zd ZdZdZdZdZd. fdd Zd
d Ze dd
Z
edd Zd/ddZ
dd Zdd Zd0 fdd Zd1ddZdd Zd2ddZd3eeedd d!d"Zd4eedd#d$d%Zd&d' Zd(d) Zd*d+ Zd5 fd,d- Z ZS )6
FTPFileSystemzA filesystem over classic FTP/Fftp N c
s\ t t| 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/tmpNr i )
superr
__init__hostporttempdircredtimeout blocksize_connect)
selfr r usernamepasswordZacct
block_sizer r kwargs) __class__ D/usr/local/lib/python3.6/site-packages/fsspec/implementations/ftp.pyr s &
zFTPFileSystem.__init__c C s2 t | jd| _| jj| j| j | jj| j d S )N)r )r r r connectr r loginr )r r r r r B s zFTPFileSystem._connectc C s dt |d jdjd S )Nr path)r lstriprstrip)clsr# r r r _strip_protocolG s zFTPFileSystem._strip_protocolc C s$ t | }|jdd |jdd |S )Nr# protocol)r pop)Zurlpathoutr r r _get_kwargs_from_urlsK s z#FTPFileSystem._get_kwargs_from_urlsTc K sf | j |}g }|| jkr2yydd | jj|D }W n tk
rV t| j|}Y nX xn|D ]f\}}|dkrrd}dj||jdg|d<