Package pyfics :: Module protocols :: Class SmartLineReceiver
[hide private]

Class SmartLineReceiver

source code

twisted.internet.protocol.BaseProtocol --+        
                                         |        
        twisted.internet.protocol.Protocol --+    
                                             |    
      twisted.protocols.basic.LineOnlyReceiver --+
                                                 |
                                                SmartLineReceiver
Known Subclasses:
ChangingLineReceiver

A protocol that received only lines. Predefined prompts are considered as lines.

Instance Methods [hide private]
 
dataReceived(self, data)
Translates bytes into lines, and calls lineReceived.
source code

Inherited from twisted.protocols.basic.LineOnlyReceiver: lineLengthExceeded, lineReceived, sendLine

Inherited from twisted.internet.protocol.Protocol: connectionLost

Inherited from twisted.internet.protocol.BaseProtocol: __providedBy__, connectionMade, makeConnection

Class Variables [hide private]
list of string linealike = []
When SmartLineReceiver receives data ending with one the strings in this list, it'll add a delimiter at the end.
bool rmlinealike = True
When set to True, used strings from prompt are removed.
int MAX_LENGTH
The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped).
string delimiter
The line-ending delimiter to use.

Inherited from twisted.protocols.basic.LineOnlyReceiver (private): _buffer

Inherited from twisted.internet.protocol.Protocol: __implemented__, __provides__

Inherited from twisted.internet.protocol.BaseProtocol: connected, transport

Method Details [hide private]

dataReceived(self, data)

source code 
Translates bytes into lines, and calls lineReceived. If data ends with any string in prompt add delimiter at the end. If promptremove is True, remove the used string from prompt.
Overrides: twisted.protocols.basic.LineOnlyReceiver.dataReceived

Class Variable Details [hide private]

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

delimiter

The line-ending delimiter to use. By default this is '\r\n'.
Type:
string