#NEWLINE# @ staticmethod #NEWLINE# def _write_archive_retrieval_job( f , job , multipart_size ) : #NEWLINE# #INDENT# if ( job . archive_size > multipart_size ) : #NEWLINE# #INDENT# def fetch( start , end ) : #NEWLINE# #INDENT# byte_range = ( start , ( end - 1 ) ) #NEWLINE# f . write ( job . get_output ( byte_range ) . read ( ) ) #NEWLINE# #UNINDENT# whole_parts = ( job . archive_size // multipart_size ) #NEWLINE# for first_byte in xrange ( 0 , ( whole_parts * multipart_size ) , multipart_size ) : #NEWLINE# #INDENT# fetch ( first_byte , ( first_byte + multipart_size ) ) #NEWLINE# #UNINDENT# remainder = ( job . archive_size % multipart_size ) #NEWLINE# if remainder : #NEWLINE# #INDENT# fetch ( ( job . archive_size - remainder ) , job . archive_size ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# f . write ( job . get_output ( ) . read ( ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# f . truncate ( job . archive_size ) #NEWLINE# #UNINDENT# except IOError as e : #NEWLINE# #INDENT# if ( e . errno != errno . ESPIPE ) : #NEWLINE# #INDENT# raise