#NEWLINE# @ flow . StateHandler ( next_state = [ 'ReadBuffer' , 'CheckHashes' ] ) #NEWLINE# def Stat( self , responses ) : #NEWLINE# #INDENT# 'Fix up the pathspec of the file.' #NEWLINE# response = responses . First ( ) #NEWLINE# if ( responses . success and response ) : #NEWLINE# #INDENT# self . state . stat = response #NEWLINE# if self . state . stat . pathspec . path : #NEWLINE# #INDENT# self . args . pathspec = self . state . stat . pathspec #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( not self . args . ignore_stat_failure ) : #NEWLINE# #INDENT# raise IOError ( ( 'Error: %s' % responses . status ) ) #NEWLINE# #UNINDENT# self . state . stat = rdf_client . StatEntry ( pathspec = self . args . pathspec ) #NEWLINE# #UNINDENT# if ( self . args . read_length == 0 ) : #NEWLINE# #INDENT# self . state . file_size = self . state . stat . st_size #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . state . file_size = self . args . read_length #NEWLINE# #UNINDENT# self . state . max_chunk_number = ( ( self . state . file_size / self . CHUNK_SIZE ) + 1 ) #NEWLINE# self . CreateBlobImage ( ) #NEWLINE# self . FetchWindow ( min ( responses . WINDOW_SIZE , ( self . state . max_chunk_number - self . state . current_chunk_number ) ) )