def process_rules(app, rules, prefix=''):
 for rule in rules:
  if callable(rule.view_func_or_data):
   view_func = rule.view_func_or_data
   renderer_name = getattr(rule.renderer, '__name__', rule.renderer.__class__.__name__)
   endpoint = '{}__{}'.format(renderer_name, rule.view_func_or_data.__name__)
   view_functions[endpoint] = rule.view_func_or_data
  else:
   view_func = data_to_lambda(rule.view_func_or_data)
   endpoint = '__'.join((route.replace('/', '') for route in rule.routes))
  wrapped_view_func = wrap_with_renderer(view_func, rule.renderer, rule.view_kwargs, debug_mode=app.debug)
  for url in rule.routes:
   try:
    app.add_url_rule((prefix + url), endpoint=(endpoint + rule.endpoint_suffix), view_func=wrapped_view_func, methods=rule.methods)
   except AssertionError:
    raise AssertionError("URLRule({}, {})'s view function name is overwriting an existing endpoint".format((prefix + url), (view_func.__name__ + rule.endpoint_suffix)))

def process_rules ( app , rules , prefix = '' ) : for rule in rules : if callable ( rule . view_func_or_data ) : view_func = rule . view_func_or_data renderer_name = getattr ( rule . renderer , '__name__' , rule . renderer . __class__ . __name__ ) endpoint = '{}__{}' . format ( renderer_name , rule . view_func_or_data . __name__ ) view_functions [ endpoint ] = rule . view_func_or_data else : view_func = data_to_lambda ( rule . view_func_or_data ) endpoint = '__' . join ( ( route . replace ( '/' , '' ) for route in rule . routes ) ) wrapped_view_func = wrap_with_renderer ( view_func , rule . renderer , rule . view_kwargs , debug_mode = app . debug ) for url in rule . routes : try : app . add_url_rule ( ( prefix + url ) , endpoint = ( endpoint + rule . endpoint_suffix ) , view_func = wrapped_view_func , methods = rule . methods ) except AssertionError : raise AssertionError ( "URLRule({}, {})'s view function name is overwriting an existing endpoint" . format ( ( prefix + url ) , ( view_func . __name__ + rule . endpoint_suffix ) ) )
add url routes to flask / werkzeug lookup table .