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`
`dict` | `ftp_reply`
`MetaInterface` | `IConsumer`
`MetaInterface` | `IFinishableConsumer`
`MetaInterface` | `IProducer`
`MetaInterface` | `IProtocol`
`_Feature` | `nested_scopes`
`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:
    `dict`
  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.',
        ...

### IConsumer

  Type:
    `MetaInterface`
  Value:

        <class 'twisted.internet.interfaces.IConsumer'>

### IFinishableConsumer

  Type:
    `MetaInterface`
  Value:

        <class 'twisted.internet.interfaces.IFinishableConsumer'>

### IProducer

  Type:
    `MetaInterface`
  Value:

        <class 'twisted.internet.interfaces.IProducer'>

### IProtocol

  Type:
    `MetaInterface`
  Value:

        <class 'twisted.internet.interfaces.IProtocol'>

### nested_scopes

  Type:
    `_Feature`
  Value:

        _Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha', 0), 16)

### reactor

  Type:
    `SelectReactor`
  Value:

        <twisted.internet.default.SelectReactor instance at 0x82e8c8c>

Generated by Epydoc 1.1 on Thu May 8 13:18:36 2003 | http://epydoc.sf.net