�
lMg�. � � � d dl Z d dlZd dlZd dlZd dlmZmZmZmZ d dl m
Z
ddlmZm
Z
ddlmZmZ G d� de
� Z G d � d
e� Z G d� de� Zdd
�Zy)� N)�FTP�FTP_TLS�Error�
error_perm)�Any� )�AbstractBufferedFile�AbstractFileSystem)�infer_storage_options�
isfilelikec �� � � e Zd ZdZdZdZdZ d� fd� Zd� Ze d� � Z
ed � � Zdd
�Z
d� Zd� Zd� fd
� Z dd�Zd� Zd d�Zddedededdfd�Zd!dededdfd�Zd� Zd� Zd� Zd"� fd� Z� xZS )#�
FTPFileSystemzA filesystem over classic FTP�/F�ftpNc �< �� t �| � di |�� || _ || _ |xs d| _ |xs d|xs d|xs df| _ || _ | | _ |�|| _ nd| _ |
| _ | j � | j r| j j � yy)a
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
encoding: str
Encoding to use for directories and filenames in FTP connection
tls: bool
Use FTP-TLS, by default False
z/tmp� Ni � )
�super�__init__�host�port�tempdir�cred�timeout�encoding� blocksize�tls�_connectr �prot_p)
�selfr r �username�password�acct�
block_sizer r r r �kwargs� __class__s
��fC:\Users\noahv\Documents\GitHub\clickup-operator\.venv\Lib\site-packages\fsspec/implementations/ftp.pyr zFTPFileSystem.__init__ s� �� �X ���"�6�"��� ��� ��(�&����N��H�N��D�J�B�>�� ���� ��
��!�'�D�N�"�D�N�����
�
���8�8��H�H�O�O�� � c �� � | j rt }nt }t j dk\ r$ || j
| j �� | _ nR| j r.t j d� || j
�� | _ n || j
�� | _ | j j | j | j � | j j | j � y )N)� � )r r z1`encoding` not supported for python<3.9, ignoring)r )r r r �sys�version_infor r r �warnings�warn�connectr r �loginr )r �ftp_clss r'