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. | |
Errback all queued deferreds. | |
This method returns a DeferredList. | |
Issues the CDUP (Change Directory UP) command. | |
connectionLost(self,
reason)
| |
Issues the CWD (Change Working Directory) command. | |
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 | |
(Private) Parses the response messages from the FTP server. | |
Retrieve a file listing into the given protocol instance. | |
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. | |
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. | |
XXX | |
Store a file at the given path. | |
Store a file at the given path. | |
Inherited from LineReceiver | |
Clear buffered data. | |
Protocol.dataReceived. | |
Called when the maximum line length has been reached. | |
Override this for when raw data is received. | |
Sets the line-mode of this receiver. | |
Sets the raw mode of this receiver. | |
Inherited from Protocol | |
(Deprecated) | |
Inherited from BaseProtocol | |
Called when a connection is made. | |
Make a connection to a transport and a server. |
Instance Variable Summary | |
---|---|
passive : See description in __init__. |
Class Variable Summary | |
---|---|
int |
debug = 0 |
Inherited from LineReceiver | |
str |
_LineReceiver__buffer = ''
|
str |
delimiter : The line-ending delimiter to use. |
int |
line_mode = 1 |
int |
MAX_LENGTH : The maximum length of a line to allow (If a sent line is longer than
this, the connection is dropped). |
Inherited from Protocol | |
tuple |
__implements__ = (<class twisted.internet.interfaces.IPr...
|
Inherited from BaseProtocol | |
int |
connected = 0 |
NoneType |
transport = None |
Method Details |
---|
__init__(self,
username='anonymous',
password='twisted@twistedmatrix.com',
passive=1)
|
_fail(self, error)Errback all queued deferreds. |
_openDataConnection(self, commands, protocol)This method returns a DeferredList. |
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, commands, protocol)Retrieves a file or listing generated by the given command, feeding it to the given protocol.
|
retr(self, path, protocol, offset=0)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, offset=0)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. |
sendToConnection(self, commands)XXX
|
stor(self, path, offset=0)Store a file at the given path. This method issues the 'STOR' FTP command.
|
storeFile(self, path, offset=0)Store a file at the given path. This method issues the 'STOR' FTP command.
|
Instance Variable Details |
---|
passiveSee description in __init__. |
Class Variable Details |
---|
debug
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:49 2004 | http://epydoc.sf.net |