Module Expr Str Import alias Import alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Num Assign NameStore Num FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Raise NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Raise NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad NameLoad attr Return Assign AttributeStore NameLoad attr BinOpAdd AttributeLoad NameLoad attr NameLoad While AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str orelse If BoolOpOr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore NameLoad If CompareLt NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr BinOpSub AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareNotEq NameLoad Num body If CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice BinOpAdd NameLoad NameLoad Expr Call AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If NameLoad body If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice UnaryOpUSub NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice UnaryOpUSub NameLoad Break orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return CompareLtE Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return UnaryOpNot BoolOpAnd CompareEq AttributeLoad NameLoad attr Str Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body While Num body If Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If CompareIs NameLoad NameLoad body If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Return orelse If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr BinOpAdd AttributeLoad NameLoad attr NameLoad Return Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr BinOpAdd AttributeLoad NameLoad attr NameLoad Return orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr orelse Return decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr If CompareLt Call NameLoad AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad If NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad NameLoad attr Return decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str While AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam defaults Num body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareGt Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice AttributeLoad NameLoad attr Return NameLoad orelse Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Return NameLoad decorator_list decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam defaults NameLoad body If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr Call NameLoad orelse Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return UnaryOpNot AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Return TupleLoad Num Call AttributeLoad AttributeLoad NameLoad attr attr orelse Return TupleLoad Num NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore BinOpSub Call NameLoad NameLoad Num While BoolOpAnd NameLoad UnaryOpNot Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad body AugAssignSub NameStore Num Return NameLoad decorator_list
N/A N/A A class supporting chat-style (command/response) protocols.

This class adds support for 'chat' style protocols - where one side
sends a 'command', and the other sends a response (examples would be
the common internet protocols - smtp, nntp, ftp, etc..).

The handle_read() method looks at the input stream for the current
'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n'
for multi-line output), calling self.found_terminator() on its
receipt.

for example:
Say you build an async nntp client using this class.  At the start
of the connection, you'll have self.terminator set to '\r\n', in
order to process the single-line greeting.  Just before issuing a
'LIST' command you'll set it to '\r\n.\r\n'.  The output of the LIST
command will be accumulated (using your own 'collect_incoming_data'
method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
 N/A socket N/A asyncore collections deque async_chat N/A N/A asyncore dispatcher N/A N/A This is an abstract class.  You must derive from this class, and add
    the two methods collect_incoming_data() and found_terminator() N/A ac_in_buffer_size 4096 N/A ac_out_buffer_size 4096 __init__ N/A N/A self conn N/A None N/A N/A N/A self ac_in_buffer N/A N/A self ac_out_buffer N/A N/A self producer_fifo N/A fifo N/A N/A N/A N/A asyncore dispatcher __init__ self conn N/A collect_incoming_data N/A N/A self data N/A N/A N/A NotImplementedError must be implemented in subclass N/A found_terminator N/A N/A self N/A N/A N/A NotImplementedError must be implemented in subclass N/A set_terminator N/A N/A self term N/A N/A N/A Set the input delimiter.  Can be a fixed string of any length, an integer, or None N/A N/A self terminator term N/A get_terminator N/A N/A self N/A N/A N/A N/A self terminator N/A handle_read N/A N/A self N/A N/A N/A N/A N/A data N/A N/A self recv N/A self ac_in_buffer_size N/A N/A N/A N/A socket error N/A why N/A N/A N/A N/A self handle_error N/A N/A N/A self ac_in_buffer N/A N/A self ac_in_buffer data N/A N/A self ac_in_buffer N/A N/A lb N/A len N/A self ac_in_buffer N/A terminator N/A N/A self get_terminator N/A N/A terminator N/A N/A N/A N/A self collect_incoming_data N/A self ac_in_buffer N/A N/A self ac_in_buffer N/A N/A N/A N/A isinstance terminator int N/A isinstance terminator long N/A N/A n terminator N/A N/A lb n N/A N/A N/A N/A self collect_incoming_data N/A self ac_in_buffer N/A N/A self ac_in_buffer N/A N/A self terminator N/A N/A self terminator lb N/A N/A N/A N/A self collect_incoming_data N/A N/A self ac_in_buffer N/A n N/A N/A self ac_in_buffer N/A N/A self ac_in_buffer N/A n N/A N/A self terminator 0 N/A N/A N/A self found_terminator N/A N/A terminator_len N/A len terminator N/A index N/A N/A N/A self ac_in_buffer find terminator N/A N/A index -1 N/A N/A N/A index 0 N/A N/A N/A N/A self collect_incoming_data N/A N/A self ac_in_buffer N/A index N/A N/A self ac_in_buffer N/A N/A self ac_in_buffer N/A N/A index terminator_len N/A N/A N/A self found_terminator N/A N/A index N/A find_prefix_at_end N/A self ac_in_buffer terminator N/A index N/A N/A N/A index lb N/A N/A N/A N/A self collect_incoming_data N/A N/A self ac_in_buffer N/A N/A index N/A N/A self ac_in_buffer N/A N/A self ac_in_buffer N/A N/A index N/A N/A N/A N/A N/A self collect_incoming_data N/A self ac_in_buffer N/A N/A self ac_in_buffer N/A handle_write N/A N/A self N/A N/A N/A N/A N/A self initiate_send N/A handle_close N/A N/A self N/A N/A N/A N/A N/A self close N/A push N/A N/A self data N/A N/A N/A N/A N/A N/A self producer_fifo push N/A simple_producer data N/A N/A N/A self initiate_send N/A push_with_producer N/A N/A self producer N/A N/A N/A N/A N/A N/A self producer_fifo push producer N/A N/A N/A self initiate_send N/A readable N/A N/A self N/A N/A N/A predicate for inclusion in the readable for select() N/A N/A N/A len N/A self ac_in_buffer N/A self ac_in_buffer_size N/A writable N/A N/A self N/A N/A N/A predicate for inclusion in the writable for select() N/A N/A N/A N/A N/A self ac_out_buffer N/A N/A N/A self producer_fifo is_empty N/A self connected N/A close_when_done N/A N/A self N/A N/A N/A automatically close this channel once the outgoing queue is empty N/A N/A N/A N/A self producer_fifo push None N/A refill_buffer N/A N/A self N/A N/A N/A 1 N/A N/A N/A len N/A self producer_fifo N/A N/A p N/A N/A N/A self producer_fifo first N/A N/A p None N/A N/A N/A N/A self ac_out_buffer N/A N/A N/A N/A N/A self producer_fifo pop N/A N/A N/A self close N/A N/A N/A N/A isinstance p str N/A N/A N/A N/A N/A self producer_fifo pop N/A N/A self ac_out_buffer N/A N/A self ac_out_buffer p N/A N/A data N/A N/A p more N/A data N/A N/A N/A self ac_out_buffer N/A N/A self ac_out_buffer data N/A N/A N/A N/A N/A N/A self producer_fifo pop N/A N/A N/A initiate_send N/A N/A self N/A N/A N/A obs N/A self ac_out_buffer_size N/A N/A N/A len N/A self ac_out_buffer obs N/A N/A N/A N/A self refill_buffer N/A N/A N/A self ac_out_buffer N/A self connected N/A N/A N/A N/A num_sent N/A N/A self send N/A N/A self ac_out_buffer N/A obs N/A num_sent N/A N/A N/A self ac_out_buffer N/A N/A self ac_out_buffer N/A num_sent N/A N/A N/A N/A socket error N/A why N/A N/A N/A N/A self handle_error N/A N/A discard_buffers N/A N/A self N/A N/A N/A N/A self ac_in_buffer N/A N/A self ac_out_buffer N/A N/A self producer_fifo N/A N/A N/A N/A N/A self producer_fifo pop N/A N/A simple_producer N/A N/A __init__ N/A N/A self data buffer_size N/A 512 N/A N/A N/A self data data N/A N/A self buffer_size buffer_size N/A more N/A N/A self N/A N/A N/A N/A N/A len N/A self data N/A self buffer_size N/A N/A result N/A N/A self data N/A N/A self buffer_size N/A N/A self data N/A N/A self data N/A N/A self buffer_size N/A result N/A N/A result N/A self data N/A N/A self data N/A result N/A N/A fifo N/A N/A __init__ N/A N/A self list N/A None N/A N/A N/A list N/A N/A N/A self list N/A deque N/A N/A N/A self list N/A deque list N/A __len__ N/A N/A self N/A N/A N/A N/A len N/A self list N/A is_empty N/A N/A self N/A N/A N/A N/A N/A self list N/A first N/A N/A self N/A N/A N/A N/A N/A self list N/A 0 N/A push N/A N/A self data N/A N/A N/A N/A N/A N/A self list append data N/A pop N/A N/A self N/A N/A N/A N/A self list N/A N/A N/A 1 N/A N/A N/A self list popleft N/A N/A N/A 0 None N/A N/A find_prefix_at_end N/A N/A haystack needle N/A N/A N/A l N/A N/A len needle 1 N/A N/A l N/A N/A N/A haystack endswith N/A needle N/A l N/A N/A l 1 N/A l N/A