def generate_adapter(adapter, name='url_for', map_name='url_map'):
 values = {u'server_name': dumps(adapter.server_name), u'script_name': dumps(adapter.script_name), u'subdomain': dumps(adapter.subdomain), u'url_scheme': dumps(adapter.url_scheme), u'name': name, u'map_name': map_name}
 return (u'var %(name)s = %(map_name)s(\n    %(server_name)s,\n    %(script_name)s,\n    %(subdomain)s,\n    %(url_scheme)s\n);' % values)

def generate_adapter ( adapter , name = 'url_for' , map_name = 'url_map' ) : values = { u'server_name' : dumps ( adapter . server_name ) , u'script_name' : dumps ( adapter . script_name ) , u'subdomain' : dumps ( adapter . subdomain ) , u'url_scheme' : dumps ( adapter . url_scheme ) , u'name' : name , u'map_name' : map_name } return ( u'var %(name)s = %(map_name)s(\n    %(server_name)s,\n    %(script_name)s,\n    %(subdomain)s,\n    %(url_scheme)s\n);' % values )
generates the url building function for a map .