def build_environment(request, response, session, store_current=True):
 environment = dict(_base_environment_)
 if (not request.env):
  request.env = Storage()
 response.models_to_run = ['^\\w+\\.py$', ('^%s/\\w+\\.py$' % request.controller), ('^%s/%s/\\w+\\.py$' % (request.controller, request.function))]
 t = environment['T'] = translator(os.path.join(request.folder, 'languages'), request.env.http_accept_language)
 c = environment['cache'] = Cache(request)
 if store_current:
  current.globalenv = environment
  current.request = request
  current.response = response
  current.session = session
  current.T = t
  current.cache = c
 if is_jython:
  global __builtins__
  __builtins__ = mybuiltin()
 environment['request'] = request
 environment['response'] = response
 environment['session'] = session
 environment['local_import'] = (lambda name, reload=False, app=request.application: local_import_aux(name, reload, app))
 BaseAdapter.set_folder(pjoin(request.folder, 'databases'))
 custom_import_install()
 return environment

def build_environment ( request , response , session , store_current = True ) : environment = dict ( _base_environment_ ) if ( not request . env ) : request . env = Storage ( ) response . models_to_run = [ '^\\w+\\.py$' , ( '^%s/\\w+\\.py$' % request . controller ) , ( '^%s/%s/\\w+\\.py$' % ( request . controller , request . function ) ) ] t = environment [ 'T' ] = translator ( os . path . join ( request . folder , 'languages' ) , request . env . http_accept_language ) c = environment [ 'cache' ] = Cache ( request ) if store_current : current . globalenv = environment current . request = request current . response = response current . session = session current . T = t current . cache = c if is_jython : global __builtins__ __builtins__ = mybuiltin ( ) environment [ 'request' ] = request environment [ 'response' ] = response environment [ 'session' ] = session environment [ 'local_import' ] = ( lambda name , reload = False , app = request . application : local_import_aux ( name , reload , app ) ) BaseAdapter . set_folder ( pjoin ( request . folder , 'databases' ) ) custom_import_install ( ) return environment
build the environment dictionary into which web2py files are executed .