#NEWLINE# def __init__( self , request = None , dbmaker = None , **kwargs ) : #NEWLINE# #INDENT# super ( SQLCache , self ) . __init__ ( request , ** kwargs ) #NEWLINE# self . dbmaker = dbmaker #NEWLINE# self . db = self . dbmaker ( ) #NEWLINE# if ( kwargs is not None ) : #NEWLINE# #INDENT# def cleanup( _ ) : #NEWLINE# #INDENT# ' Close the session after the request ' #NEWLINE# self . db . close ( ) #NEWLINE# #UNINDENT# request . add_finished_callback ( cleanup )