Dashboard
PHP:
8.2.30
OS:
Linux
User:
dh_nv8b2m
/
/
usr
/
share
/
dput
/
dput
/
methods
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: ftp.cpython-310.pyc
o ��d� � @ s@ d Z ddlZddlZddlZddlZddlmZ ddd�ZdS ) z' Implementation for FTP upload method. � N� )� dputhelper� c C s� zt �� }|�| |� |rtj�d| � W n t jy6 } ztj�d| � t�d� W Y d} ~ nd} ~ ww |d | d } |dkrFd}nt�| �}z|� ||� W n( t j yh tj�d � t�d� Y n ty{ tj�d � t�d� Y nw |�|dk� z|� |� W n. t j y� } z!| jr�| jd dd� d kr�tj�d� t�d� n� W Y d} ~ nd} ~ ww |r�tj�d| � |D ]�}tj�|�\} }zc|r�tj�d| � |r�zt�|�j}W n ty� d}|r�tj�d| � Y nw t|d�}|�rtj||tj|d�}tj�d| � tj�� |�d| |d� |�� tj�d� tj�� W q� t j�y� } zetj�d| � t| t j��ro| j�ro| jd dd� dk�rotj�d| � tj�d� W Y d} ~ q�t| t j��r�| j�r�| jd dd� dk�r�tj�d� |�r�tj�d� � t�d� W Y d} ~ q�d} ~ ww z|�� W dS t�y� } z|�r�tj�d | � � W Y d} ~ dS d} ~ ww )!zU Upload the files via FTP. (Could need a bit more error-checking.) zD: FTP-Connection to host: %s z3Connection failed, aborting. Check your network %s � N�@z password: � anonymouszdput@packages.debian.orgzWrong Password zServer closed the connection r � �550z'Directory to upload to does not exist. zD: Directory to upload to: %s zD: Uploading File: %s ���z(D: Determining size of file '%s' failed �rb)�ptype� progressf�sizez Uploading %s: zSTOR i zdone. z%s �553z1Leaving existing %s on the server and continuing a NOTE: This existing file may have been previously uploaded partially. For official Debian upload queues, the dcut(1) utility can be used to remove this file, and after an acknowledgement mail is received in response to dcut, the upload can be re-initiated. �5z�Note: This error might indicate a problem with your passive_ftp setting. Please consult dput.cf(5) for details on this configuration option. zAD: Should exit silently now, but will throw exception for debug. zgD: Exception %s while attempting to quit ftp session. D: Throwing an exception for debugging purposes. )�ftplib�FTP�connect�sys�stdout�write� all_errors�exit�getpass�login� error_perm�EOFError�set_pasv�cwd�args�os�path�split�stat�st_size� Exception�openr �FileWithProgress�flush� storbinary�close� isinstance�Error�quit)�fqdnr �incoming�files_to_upload�debug�ftp_mode�progress�port�ftp_connection�e�prompt�password� file_path�file_directory� file_namer �f� r= �#/usr/share/dput/dput/methods/ftp.py�upload s� ����� �������� � � ����� ������ �����r? )r r )�__doc__r r r r �helperr r? r= r= r= r>