A tube which could convert "frames" - discrete chunks of data - into "segments" - parts of a raw data stream, with framing headers or delimiters attached.

Parameters_receivedthe sendString method, a 1-argument callable taking bytes. (type: callable)
Method __init__ Undocumented
Method started Flush any greeting data that has come from the wrapped framing parser.
Method received A frame was received, manipulate it and yield a segment or segments.
Method _unflush Put the given segments into the output buffer.
Method _flush Clear the output buffer and return its previous contents.
def __init__(self, stringReceiver, sendMethodName='sendString'):
Undocumented
def started(self):

Flush any greeting data that has come from the wrapped framing parser.

Returnsany bytes written by makeConnection
def received(self, data):

A frame was received, manipulate it and yield a segment or segments.

Parametersdataa frame.
Returnsa sequence of segments with appropriate framing information embedded to frame data.
def _unflush(self, input):

Put the given segments into the output buffer.

Parametersinputsome values written to the underlying receiver's transport. (type: bytes)
def _flush(self):

Clear the output buffer and return its previous contents.

Returnsthe current output buffer. (type: list of bytes, each representing a segment.)
API Documentation for tubes, generated by pydoctor at 2016-01-18 07:46:47.