def generate_map(map, name='url_map'):
 from warnings import warn
 warn(DeprecationWarning('This module is deprecated'))
 map.update()
 rules = []
 converters = []
 for rule in map.iter_rules():
  trace = [{'is_dynamic': is_dynamic, 'data': data} for (is_dynamic, data) in rule._trace]
  rule_converters = {}
  for (key, converter) in iteritems(rule._converters):
   js_func = js_to_url_function(converter)
   try:
    index = converters.index(js_func)
   except ValueError:
    converters.append(js_func)
    index = (len(converters) - 1)
   rule_converters[key] = index
  rules.append({u'endpoint': rule.endpoint, u'arguments': list(rule.arguments), u'converters': rule_converters, u'trace': trace, u'defaults': rule.defaults})
 return render_template(name_parts=((name and name.split('.')) or []), rules=dumps(rules), converters=converters)

def generate_map ( map , name = 'url_map' ) : from warnings import warn warn ( DeprecationWarning ( 'This module is deprecated' ) ) map . update ( ) rules = [ ] converters = [ ] for rule in map . iter_rules ( ) : trace = [ { 'is_dynamic' : is_dynamic , 'data' : data } for ( is_dynamic , data ) in rule . _trace ] rule_converters = { } for ( key , converter ) in iteritems ( rule . _converters ) : js_func = js_to_url_function ( converter ) try : index = converters . index ( js_func ) except ValueError : converters . append ( js_func ) index = ( len ( converters ) - 1 ) rule_converters [ key ] = index rules . append ( { u'endpoint' : rule . endpoint , u'arguments' : list ( rule . arguments ) , u'converters' : rule_converters , u'trace' : trace , u'defaults' : rule . defaults } ) return render_template ( name_parts = ( ( name and name . split ( '.' ) ) or [ ] ) , rules = dumps ( rules ) , converters = converters )
generates a javascript function containing the rules defined in this map .