def make_map(declarations):
 mapper = routes.Mapper()
 for (route, targets) in declarations.items():
  allowed_methods = []
  for method in targets:
   mapper.connect(route, action=targets[method], conditions=dict(method=[method]))
   allowed_methods.append(method)
  allowed_methods = ', '.join(allowed_methods)
  mapper.connect(route, action=handle_405, _methods=allowed_methods)
 return mapper

def make_map ( declarations ) : mapper = routes . Mapper ( ) for ( route , targets ) in declarations . items ( ) : allowed_methods = [ ] for method in targets : mapper . connect ( route , action = targets [ method ] , conditions = dict ( method = [ method ] ) ) allowed_methods . append ( method ) allowed_methods = ', ' . join ( allowed_methods ) mapper . connect ( route , action = handle_405 , _methods = allowed_methods ) return mapper
process route declarations to create a route mapper .