Package twisted :: Package protocols :: Module ftp
[show private | hide private]
[frames | no frames]

Module twisted.protocols.ftp

File Transfer Protocol support for Twisted Python.

Stability: semi-stable

Maintainer: U{Andrew Bennetts<mailto:spiv@twistedmatrix.com>}

Future Plans: The server will be re-written.  The goal for the server is that
it should be secure, high-performance, and overloaded with stupid features.
The client is probably fairly final, but should share more code with the
server, and some details could still change.

Server TODO:

 * Authorization
   User / Password is stored in a dict (factory.userdict) in plaintext
   Use cred
   Separate USER / PASS from mainloop

 * Ascii-download
   Currently binary only. Ignores TYPE

 * Missing commands
   HELP, REST, STAT, ...

 * Print out directory-specific messages
   As in READMEs etc

 * Testing
   Test at every ftp-program available and on any platform.
   Automated tests

 * Security
   PORT needs to reply correctly if it fails
   The paths are done by os.path; use the "undocumented" module posixpath

 * Etc
   Documentation, Logging, Procedural content, Localization, Telnet PI,
   stop LIST from blocking...
   Highest priority: Resources.

DOCS:

 * Base information: RFC0959
 * Security: RFC2577

Classes
DTP A Client/Server-independent implementation of the DTP-protocol.
DTPFactory The DTP-Factory.
FTP An FTP server.
FTPClient A Twisted FTP Client
FTPCommand  
FTPFactory  
FTPFileListProtocol Parser for standard FTP file listings
ObjectWrapper Simple wrapper for an object
SendFileTransfer Producer, server to client

Exceptions
BadResponse  
CommandFailed  
ConnectionLost  
FTPError  
UnexpectedResponse  

Function Summary
  parsePWDResponse(response)
Returns the path from a response to a PWD command.

Variable Summary
int FAILURE
dictionary ftp_reply
SelectReactor reactor

Function Details

parsePWDResponse(response)

Returns the path from a response to a PWD command.

Responses typically look like:
   257 "/home/andrew" is current directory.

For this example, I will return '/home/andrew'.

If I can't find the path, I return None.

Variable Details

FAILURE

Type:
int
Value:
0                                                                      

ftp_reply

Type:
dictionary
Value:
{'abort': '226 Abort successful',
 'cwdok': '250 CWD command successful.',
 'epsv': '229 Entering Extended Passive Mode (|||%s|).',
 'file': '150 File status okay; about to open data connection.',
 'fileok': '226 Transfer Complete.',
 'getabort': '426 Transfer aborted.  Data connection closed.',
 'goodbye': '221 Goodbye.',
 'guest': '331 Guest login ok, type your name as password.',
...                                                                    

reactor

Type:
SelectReactor
Value:
<twisted.internet.default.SelectReactor instance at 0x834759c>         

Generated by Epydoc 1.1 on Sat Feb 15 21:17:57 2003 http://epydoc.sf.net