twisted.protocols.dict.DictClient

Package twisted :: Package protocols :: Module dict :: Class DictClient |
[frames | no frames]

## Class DictClient

    BaseProtocol --+
                   |
            Protocol --+
                       |
            LineReceiver --+
                           |
                          DictClient

Known Subclasses:
  `DictLookup`

dict (RFC2229) client

Method Summary
| `__init__(self)`
| ``connectionMade`(self)` Called when a connection is made.
| ``defineDone`(self, result)` override to catch succesful DEFINE
| ``defineFailed`(self, reason)` override to catch reasonable failure responses to DEFINE
| ``dictCode_150_define`(self, line)` n definitions retrieved
| ``dictCode_151_define`(self, line)` Definition text follows
| ``dictCode_152_match`(self, line)` n matches found, text follows
| ``dictCode_220_conn`(self, line)` Greeting message
| ``dictCode_221_ready`(self, line)` We are about to get kicked off, do nothing
| ``dictCode_250_define`(self, line)` ok
| ``dictCode_250_match`(self, line)` ok
| `dictCode_420_conn(self)`
| `dictCode_421_conn(self)`
| `dictCode_530_conn(self)`
| ``dictCode_550_define`(self, line)` Invalid database
| ``dictCode_550_match`(self, line)` Invalid database
| ``dictCode_551_match`(self, line)` Invalid strategy
| ``dictCode_552_define`(self, line)` No match
| ``dictCode_552_match`(self, line)` No match
| ``dictCode_default`(self, line)` Unkown message
| ``dictCode_text_define`(self, line)` A line of definition text received
| ``dictCode_text_match`(self, line)` One line of match text received
| ``dictConnected`(self)` override to be notified when the server is ready to accept commands
| ``lineReceived`(self, line)` Override this for when each line is received.
| ``matchDone`(self, result)` override to catch succesful MATCH
| ``matchFailed`(self, reason)` override to catch resonable failure responses to MATCH
| ``protocolError`(self, reason)` override to catch unexpected dict protocol conditions
| ``sendDefine`(self, database, word)` Send a dict DEFINE command
| ``sendLine`(self, line)` Throw up if the line is longer than 1022 characters
| ``sendMatch`(self, database, strategy, word)` Send a dict MATCH command
Inherited from LineReceiver
| ``clearLineBuffer`(self)` Clear buffered data.
| ``dataReceived`(self, data)` Protocol.dataReceived.
| ``lineLengthExceeded`(self, line)` Called when the maximum line length has been reached.
| ``rawDataReceived`(self, data)` Override this for when raw data is received.
| ``setLineMode`(self, extra)` Sets the line-mode of this receiver.
| ``setRawMode`(self)` Sets the raw mode of this receiver.
Inherited from Protocol
| ``connectionFailed`(self)` (Deprecated)
| ``connectionLost`(self, reason)` Called when the connection is shut down.
Inherited from BaseProtocol
| ``makeConnection`(self, transport)` Make a connection to a transport and a server.

Class Variable Summary
`NoneType` | `data` = None
`NoneType` | `factory` = None
`int` | `MAX_LENGTH`: The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped).
`NoneType` | `mode` = None
`NoneType` | `result` = None
`NoneType` | `state` = None
Inherited from LineReceiver
`str` | `_LineReceiver__buffer` = `''`
`str` | `delimiter`: The line-ending delimiter to use.
`int` | `line_mode` = 1
Inherited from Protocol
`tuple` | `__implements__` = `(<class twisted.internet.interfaces.IPr...`
Inherited from BaseProtocol
`int` | `connected` = 0
`NoneType` | `transport` = None

Method Details

### connectionMade(self) Called when a connection is made. This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here. Overrides: `twisted.internet.protocol.BaseProtocol.connectionMade` (inherited documentation)

### defineDone(self, result) override to catch succesful DEFINE

### defineFailed(self, reason) override to catch reasonable failure responses to DEFINE

### dictCode_150_define(self, line) n definitions retrieved

### dictCode_151_define(self, line) Definition text follows

### dictCode_152_match(self, line) n matches found, text follows

### dictCode_220_conn(self, line) Greeting message

### dictCode_221_ready(self, line) We are about to get kicked off, do nothing

### dictCode_250_define(self, line) ok

### dictCode_250_match(self, line) ok

### dictCode_550_define(self, line) Invalid database

### dictCode_550_match(self, line) Invalid database

### dictCode_551_match(self, line) Invalid strategy

### dictCode_552_define(self, line) No match

### dictCode_552_match(self, line) No match

### dictCode_default(self, line) Unkown message

### dictCode_text_define(self, line) A line of definition text received

### dictCode_text_match(self, line) One line of match text received

### dictConnected(self) override to be notified when the server is ready to accept commands

### lineReceived(self, line) Override this for when each line is received. Overrides: `twisted.protocols.basic.LineReceiver.lineReceived` (inherited documentation)

### matchDone(self, result) override to catch succesful MATCH

### matchFailed(self, reason) override to catch resonable failure responses to MATCH

### protocolError(self, reason) override to catch unexpected dict protocol conditions

### sendDefine(self, database, word) Send a dict DEFINE command

### sendLine(self, line) Throw up if the line is longer than 1022 characters Overrides: `twisted.protocols.basic.LineReceiver.sendLine`

### sendMatch(self, database, strategy, word) Send a dict MATCH command

Class Variable Details

    ### data Type: `NoneType` Value:
        None

    ### factory Type: `NoneType` Value:
        None

    ### MAX_LENGTH The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped). Default is 16384. Type: `int` Value:
        1024

    ### mode Type: `NoneType` Value:
        None

    ### result Type: `NoneType` Value:
        None

    ### state Type: `NoneType` Value:
        None

Generated by Epydoc 2.0 on Sat May 15 20:08:15 2004 | http://epydoc.sf.net