def map_url_in(request, env, app=False):
 THREAD_LOCAL.routes = params
 map = MapUrlIn(request=request, env=env)
 map.sluggify()
 map.map_prefix()
 map.map_app()
 if params.routes_app:
  THREAD_LOCAL.routes = params_apps.get(app, params)
 if app:
  return map.application
 (root_static_file, version) = map.map_root_static()
 if root_static_file:
  map.update_request()
  return (root_static_file, version, map.env)
 if (map.languages and (map.map_static is False) and (map.arg0 == 'static') and (map.args(1) in map.languages)):
  map.map_controller()
  map.map_language()
 else:
  map.map_language()
  map.map_controller()
 (static_file, version) = map.map_static()
 if static_file:
  map.update_request()
  return (static_file, version, map.env)
 map.map_function()
 map.validate_args()
 map.update_request()
 return (None, None, map.env)

def map_url_in ( request , env , app = False ) : THREAD_LOCAL . routes = params map = MapUrlIn ( request = request , env = env ) map . sluggify ( ) map . map_prefix ( ) map . map_app ( ) if params . routes_app : THREAD_LOCAL . routes = params_apps . get ( app , params ) if app : return map . application ( root_static_file , version ) = map . map_root_static ( ) if root_static_file : map . update_request ( ) return ( root_static_file , version , map . env ) if ( map . languages and ( map . map_static is False ) and ( map . arg0 == 'static' ) and ( map . args ( 1 ) in map . languages ) ) : map . map_controller ( ) map . map_language ( ) else : map . map_language ( ) map . map_controller ( ) ( static_file , version ) = map . map_static ( ) if static_file : map . update_request ( ) return ( static_file , version , map . env ) map . map_function ( ) map . validate_args ( ) map . update_request ( ) return ( None , None , map . env )
routes incoming url .