#NEWLINE# def sign( self , app , signer ) : #NEWLINE# #INDENT# temp = tempfile . NamedTemporaryFile ( 'wb' , delete = False ) #NEWLINE# self . f . seek ( 0 ) #NEWLINE# temp . write ( self . f . read ( ) ) #NEWLINE# temp . seek ( 0 ) #NEWLINE# for arch in self . arches : #NEWLINE# #INDENT# ( offset , new_codesig_data ) = self . _sign_arch ( arch , app , signer ) #NEWLINE# write_offset = ( arch [ 'macho' ] . macho_start + signer ) #NEWLINE# temp . seek ( write_offset ) #NEWLINE# temp . write ( new_codesig_data ) #NEWLINE# #UNINDENT# temp . seek ( 0 ) #NEWLINE# macho . MachoFile . build_stream ( self . m , temp ) #NEWLINE# temp . close ( ) #NEWLINE# os . rename ( temp . name , self . path )