pex.proto.ftp.client

Module Contents

class pex.proto.ftp.client.FTPClient(host: str, port: int, timeout: int = 10, ssl: bool = False)

Bases: object

Subclass of pex.proto.ftp module.

This subclass of pex.proto.ftp module represents Python implementation of the FTP client.

connect() None

Connect to FTP socket.

Return None:

None

Raises:

RuntimeError – with trailing error message

close() None

Close FTP socket.

Return None:

None

Raises:

RuntimeError – with trailing error message

login(username: str, password: str) None

Login to the FTP socket.

Parameters:
  • username (str) – FTP username

  • password (str) – FTP password

Return None:

None

Raises:

RuntimeError – with trailing error message

get_file(remote_file: str) bytes

Get remote file from FTP socket.

Parameters:

remote_file (str) – remote file to get

Return bytes:

remote file contents