Home | Trees | Index | Help |
---|
Package twisted :: Package protocols :: Module ftp :: Class FTPClient |
|
BaseProtocol
--+ |Protocol
--+ |LineReceiver
--+ | FTPClient
A Twisted FTP Client
Supports active and passive transfers.
This class is semi-stable.Method Summary | |
---|---|
Constructor. | |
Issues the CDUP (Change Directory UP) command. | |
(Deprecated) (inherited from Protocol )
| |
Called when the connection is shut down. (inherited from Protocol )
| |
Called when a connection is made. (inherited from BaseProtocol )
| |
Issues the CWD (Change Working Directory) command. | |
Protocol.dataReceived. (inherited from LineReceiver )
| |
Returns a FTP escaped path (replace newlines with nulls) | |
Disconnect, and also give an error to any queued deferreds. | |
(Private) Generates the text of a given PORT command | |
Called when the maximum line length has been reached. (inherited from LineReceiver )
| |
(Private) Parses the response messages from the FTP server. | |
Retrieve a file listing into the given protocol instance. | |
Make a connection to a transport and a server. (inherited from BaseProtocol )
| |
Retrieve a short file listing into the given protocol instance. | |
Return the front element of the command queue, or None if empty. | |
Issues the PWD (Print Working Directory) command. | |
Add an FTPCommand object to the queue. | |
Initialise the connection. | |
Queues a string to be issued as an FTP command | |
Issues the QUIT command. | |
Override this for when raw data is received. (inherited from LineReceiver )
| |
Retrieves a file or listing generated by the given command, feeding it to the given protocol. | |
Retrieve a file from the given path | |
Retrieve a file from the given path | |
(Private) Sends a line, unless line is None. | |
(Private) Processes the next command in the queue. | |
sendToConnection(self,
command)
| |
Sets the line-mode of this receiver. (inherited from LineReceiver )
| |
Sets the raw mode of this receiver. (inherited from LineReceiver )
| |
Store a file at the given path. | |
Store a file at the given path. | |
This method *twitch* returns a list of Deferreds *twitch* but the last element is a DeferredList based on the elements prior to *twitch* it. |
Instance Variable Summary | |
---|---|
passive
- See description in __init__. |
Class Variable Summary | |
---|---|
int |
debug
|
Method Details |
---|
__init__(self,
username='anonymous',
password='twisted@twistedmatrix.com',
passive=1)
|
cdup(self)Issues the CDUP (Change Directory UP) command.
|
cwd(self, path)Issues the CWD (Change Working Directory) command.
|
escapePath(self, path)Returns a FTP escaped path (replace newlines with nulls) |
fail(self, error)Disconnect, and also give an error to any queued deferreds. |
generatePortCommand(self, portCmd)(Private) Generates the text of a given PORT command |
lineReceived(self, line)(Private) Parses the response messages from the FTP server. |
list(self, path, protocol)Retrieve a file listing into the given protocol instance. This method issues the 'LIST' FTP command.
|
nlst(self, path, protocol)Retrieve a short file listing into the given protocol instance. This method issues the 'NLST' FTP command. NLST (should) return a list of filenames, one per line.
|
popCommandQueue(self)Return the front element of the command queue, or None if empty. |
pwd(self)Issues the PWD (Print Working Directory) command.
|
queueCommand(self, ftpCommand)Add an FTPCommand object to the queue. If it's the only thing in the queue, and we are connected and we aren't waiting for a response of an earlier command, the command will be sent immediately.
|
queueLogin(self)Initialise the connection. Login, send the password, set retrieval mode to binary |
queueStringCommand(self, command, public=1)Queues a string to be issued as an FTP command
|
quit(self)Issues the QUIT command. |
receiveFromConnection(self, command, protocol)Retrieves a file or listing generated by the given command, feeding it to the given protocol.
|
retr(self, path, protocol)Retrieve a file from the given path This method issues the 'RETR' FTP command. The file is fed into the given Protocol instance. The data connection will be passive if self.passive is set. |
retrieveFile(self, path, protocol)Retrieve a file from the given path This method issues the 'RETR' FTP command. The file is fed into the given Protocol instance. The data connection will be passive if self.passive is set. |
sendLine(self, line)(Private) Sends a line, unless line is None. |
sendNextCommand(self)(Private) Processes the next command in the queue. |
stor(self, path)Store a file at the given path. This method issues the 'STOR' FTP command.
|
storeFile(self, path)Store a file at the given path. This method issues the 'STOR' FTP command.
|
_openDataConnection(self, command, protocol)This method *twitch* returns a list of Deferreds *twitch* but the last element is a DeferredList based on the elements prior to *twitch* it. |
Instance Variable Details |
---|
passiveSee description in __init__. |
Class Variable Details |
---|
debug
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.1 on Thu May 8 13:18:37 2003 | http://epydoc.sf.net |