#NEWLINE# def __enter__( self ) : #NEWLINE# #INDENT# db = self . dbmgr . _transaction_local . wdb #NEWLINE# if ( not self ) : #NEWLINE# #INDENT# db = self . dbmgr . _transaction_local . rdb #NEWLINE# if db : #NEWLINE# #INDENT# db = ConnectionWrapper ( db . cnx , db . log ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# db = self . dbmgr . get_connection ( ) #NEWLINE# #UNINDENT# self . dbmgr . _transaction_local . wdb = self . db = db #NEWLINE# #UNINDENT# return db