#NEWLINE# def __init__( self , app , socketio , namespace = None ) : #NEWLINE# #INDENT# def _mock_send_packet( sid , pkt ) : #NEWLINE# #INDENT# if ( ( pkt . packet_type == packet . EVENT ) or ( pkt . packet_type == packet . BINARY_EVENT ) ) : #NEWLINE# #INDENT# if ( sid not in self . queue ) : #NEWLINE# #INDENT# self . queue [ sid ] = [ ] #NEWLINE# #UNINDENT# if ( ( pkt . data [ 0 ] == 'message' ) or ( pkt . data [ 0 ] == 'json' ) ) : #NEWLINE# #INDENT# self . queue [ sid ] . append ( { #NEWLINE# #INDENT# 'name' : pkt . data [ 0 ] , #NEWLINE# 'args' : pkt . data [ 1 ] , #NEWLINE# 'namespace' : ( pkt . namespace or '/' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . queue [ sid ] . append ( { #NEWLINE# #INDENT# 'name' : pkt . data [ 0 ] , #NEWLINE# 'args' : pkt . data [ 1 : ] , #NEWLINE# 'namespace' : ( pkt . namespace or '/' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( pkt . packet_type == packet . ACK ) or ( pkt . packet_type == packet . BINARY_ACK ) ) : #NEWLINE# #INDENT# self . ack = { #NEWLINE# #INDENT# 'args' : pkt . data , #NEWLINE# 'namespace' : ( pkt . namespace or '/' ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . app = app #NEWLINE# self . sid = uuid . uuid4 ( ) . hex #NEWLINE# self . callback_counter = 0 #NEWLINE# self . socketio = socketio #NEWLINE# socketio . server . _send_packet = _mock_send_packet #NEWLINE# socketio . server . environ [ self . sid ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . connect ( namespace )