#NEWLINE# def _process_rawq( self ) : #NEWLINE# #INDENT# buf = [ '' , '' ] #NEWLINE# try : #NEWLINE# #INDENT# while self . _rawq : #NEWLINE# #INDENT# c = self . _rawq_getchar ( ) #NEWLINE# if ( not self . iacseq ) : #NEWLINE# #INDENT# if ( c == NULL ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( c == '\x11' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( c != IAC ) : #NEWLINE# #INDENT# buf [ self . sb ] += c #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . iacseq += c #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( self . iacseq ) == 1 ) : #NEWLINE# #INDENT# if ( c in ( DO , DONT , WILL , WONT ) ) : #NEWLINE# #INDENT# self . iacseq += c #NEWLINE# continue #NEWLINE# #UNINDENT# self . iacseq = '' #NEWLINE# if ( c == IAC ) : #NEWLINE# #INDENT# buf [ self . sb ] += c #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( c == SB ) : #NEWLINE# #INDENT# self . sb = 1 #NEWLINE# self . sbdataq = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( c == SE ) : #NEWLINE# #INDENT# self . sb = 0 #NEWLINE# self . sbdataq += buf [ 1 ] #NEWLINE# buf [ 1 ] = '' #NEWLINE# self . _suboption ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logging . warning ( 'Telnet: IAC {!r} not recognized' . format ( c ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( self . iacseq ) == 2 ) : #NEWLINE# #INDENT# cmd = self . iacseq [ 1 ] #NEWLINE# self . iacseq = '' #NEWLINE# if ( cmd in ( DO , DONT , WILL , WONT ) ) : #NEWLINE# #INDENT# self . _neg_option ( cmd , c ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logging . error ( 'telnet bad command: {!r}' . format ( cmd ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except EOFError : #NEWLINE# #INDENT# self . iacseq = '' #NEWLINE# self . sb = 0 #NEWLINE# #UNINDENT# self . _q += buf [ 0 ] #NEWLINE# self . sbdataq += buf [ 1 ]