#NEWLINE# def _parse_options( self ) : #NEWLINE# #INDENT# '\n        Method that deals with parsing/validation options provided by the\n        client.\n        ' #NEWLINE# opts_to_ack = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# del self . _options [ 'retries' ] #NEWLINE# del self . _options [ 'default_timeout' ] #NEWLINE# logging . info ( 'Options requested from peer {}:  {}' . format ( self . _peer , self . _options ) ) #NEWLINE# self . _stats . options_in = self . _options #NEWLINE# if ( ( 'mode' in self . _options ) and ( self . _options [ 'mode' ] == 'netascii' ) ) : #NEWLINE# #INDENT# self . _response_data = NetasciiReader ( self . _response_data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( 'mode' in self . _options ) and ( self . _options [ 'mode' ] != 'octet' ) ) : #NEWLINE# #INDENT# self . _stats . error = { #NEWLINE# #INDENT# 'error_code' : constants . ERR_ILLEGAL_OPERATION , #NEWLINE# 'error_message' : ( 'Unknown mode: %r' % self . _options [ 'mode' ] ) , #NEWLINE# #UNINDENT# } #NEWLINE# self . _transmit_error ( ) #NEWLINE# self . _close ( ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# if ( 'blksize' in self . _options ) : #NEWLINE# #INDENT# opts_to_ack [ 'blksize' ] = self . _options [ 'blksize' ] #NEWLINE# self . _block_size = int ( self . _options [ 'blksize' ] ) #NEWLINE# #UNINDENT# if ( 'tsize' in self . _options ) : #NEWLINE# #INDENT# self . _tsize = self . _response_data . size ( ) #NEWLINE# if ( self . _tsize is not None ) : #NEWLINE# #INDENT# opts_to_ack [ 'tsize' ] = str ( self . _tsize ) #NEWLINE# #UNINDENT# #UNINDENT# if ( 'timeout' in self . _options ) : #NEWLINE# #INDENT# opts_to_ack [ 'timeout' ] = self . _options [ 'timeout' ] #NEWLINE# self . _timeout = int ( opts_to_ack [ 'timeout' ] ) #NEWLINE# #UNINDENT# self . _options = opts_to_ack #NEWLINE# logging . info ( 'Options to ack for peer {}:  {}' . format ( self . _peer , self . _options ) ) #NEWLINE# self . _stats . blksize = self . _block_size #NEWLINE# self . _stats . options = self . _options #NEWLINE# self . _stats . options_acked = self . _options