protocol.ftp.stream Module

FTP Streams

class wpull.protocol.ftp.stream.ControlStream(connection: wpull.network.connection.Connection)[source]

Bases: object

Stream class for a control connection.

Parameters:connection – Connection.
close()[source]

Close the connection.

closed() → bool[source]

Return whether the connection is closed.

data_event_dispatcher
read_reply() → wpull.protocol.ftp.request.Reply[source]

Read a reply from the stream.

Returns:The reply
Return type:ftp.request.Reply

Coroutine.

reconnect()[source]

Connected the stream if needed.

Coroutine.

write_command(command: wpull.protocol.ftp.request.Command)[source]

Write a command to the stream.

Parameters:command – The command.

Coroutine.

class wpull.protocol.ftp.stream.DataStream(connection: wpull.network.connection.Connection)[source]

Bases: object

Stream class for a data connection.

Parameters:connection – Connection.
close()[source]

Close connection.

closed() → bool[source]

Return whether the connection is closed.

data_event_dispatcher
read_file(file: typing.Union=None)[source]

Read from connection to file.

Parameters:file – A file object or a writer stream.