#NEWLINE# def _load( self , filename , uri ) : #NEWLINE# #INDENT# self . _mutex . acquire ( ) #NEWLINE# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return self . _collection [ uri ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# if ( self . modulename_callable is not None ) : #NEWLINE# #INDENT# module_filename = self . modulename_callable ( filename , uri ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# module_filename = None #NEWLINE# #UNINDENT# self . _collection [ uri ] = template = Template ( uri = uri , filename = posixpath . normpath ( filename ) , lookup = self , module_filename = module_filename , ** self . template_args ) #NEWLINE# return template #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . _collection . pop ( uri , None ) #NEWLINE# raise #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# self . _mutex . release ( )