#NEWLINE# def executemany( self , query , params = None ) : #NEWLINE# #INDENT# if ( ( params is not None ) and ( not isinstance ( params , ( list , tuple ) ) ) ) : #NEWLINE# #INDENT# params = list ( params ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# args = [ ( ':arg%d' % i ) for i in range ( len ( params [ 0 ] ) ) ] #NEWLINE# #UNINDENT# except ( IndexError , TypeError ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( query . endswith ( ';' ) or query . endswith ( '/' ) ) : #NEWLINE# #INDENT# query = query [ : ( - 1 ) ] #NEWLINE# #UNINDENT# query = convert_unicode ( ( query % tuple ( args ) ) , self . charset ) #NEWLINE# formatted = [ self . _format_params ( i ) for i in params ] #NEWLINE# self . _guess_input_sizes ( formatted ) #NEWLINE# try : #NEWLINE# #INDENT# return self . cursor . executemany ( query , [ self . _param_generator ( p ) for p in formatted ] ) #NEWLINE# #UNINDENT# except Database . IntegrityError as e : #NEWLINE# #INDENT# six . reraise ( utils . IntegrityError , utils . IntegrityError ( * tuple ( e . args ) ) , sys . exc_info ( ) [ 2 ] ) #NEWLINE# #UNINDENT# except Database . DatabaseError as e : #NEWLINE# #INDENT# if ( hasattr ( e . args [ 0 ] , 'code' ) and ( e . args [ 0 ] . code == 1400 ) and ( not isinstance ( e , IntegrityError ) ) ) : #NEWLINE# #INDENT# six . reraise ( utils . IntegrityError , utils . IntegrityError ( * tuple ( e . args ) ) , sys . exc_info ( ) [ 2 ] ) #NEWLINE# #UNINDENT# six . reraise ( utils . DatabaseError , utils . DatabaseError ( * tuple ( e . args ) ) , sys . exc_info ( ) [ 2 ] )