def regex_select(env=None, app=None, request=None):
 if app:
  THREAD_LOCAL.routes = params_apps.get(app, params)
 elif (env and params.routes_app):
  if routers:
   map_url_in(request, env, app=True)
  else:
   app = regex_uri(env, params.routes_app, 'routes_app')
   THREAD_LOCAL.routes = params_apps.get(app, params)
 else:
  THREAD_LOCAL.routes = params
 log_rewrite(('select routing parameters: %s' % THREAD_LOCAL.routes.name))
 return app

def regex_select ( env = None , app = None , request = None ) : if app : THREAD_LOCAL . routes = params_apps . get ( app , params ) elif ( env and params . routes_app ) : if routers : map_url_in ( request , env , app = True ) else : app = regex_uri ( env , params . routes_app , 'routes_app' ) THREAD_LOCAL . routes = params_apps . get ( app , params ) else : THREAD_LOCAL . routes = params log_rewrite ( ( 'select routing parameters: %s' % THREAD_LOCAL . routes . name ) ) return app
selects a set of regex rewrite params for the current request .