#NEWLINE# def query( db , queryline , args = ( ) ) : #NEWLINE# #INDENT# if ( db == None ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# cur = db . cursor ( ) #NEWLINE# cur . execute ( queryline , args ) #NEWLINE# try : #NEWLINE# #INDENT# result = cur . fetchall ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# result = [ ] #NEWLINE# #UNINDENT# cur . close ( ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# db . rollback ( ) #NEWLINE# sys . stderr . write ( ( '%s' % e ) ) #NEWLINE# result = [ ] #NEWLINE# #UNINDENT# return result