def route_child(self, environ, start_response): req = webob.Request(environ) ctx = contexts.Ctx(req) variable_name, error = conv.pipe(conv.cleanup_line, conv.not_none)(req.urlvars.get("name"), state=ctx) child = self.child_from_node(ctx, unique_name=variable_name or u"") if error is not None: return wsgihelpers.not_found(ctx, body=child.render_not_found(ctx))(environ, start_response) return child.route(environ, start_response)
def route(self, environ, start_response): req = webob.Request(environ) ctx = contexts.Ctx(req) if self.name is None: return wsgihelpers.not_found(ctx, body=self.render_not_found(ctx))(environ, start_response) http_error = self.can_access(ctx, check=True) if http_error is not None: return http_error(environ, start_response) router = urls.make_router(*self.routings) return router(environ, start_response)
def route(self, environ, start_response): req = webob.Request(environ) ctx = contexts.Ctx(req) if self.name is None: return wsgihelpers.not_found(ctx, body=self.render_not_found())( environ, start_response) http_error = self.can_access(check=True) if http_error is not None: return http_error(environ, start_response) router = urls.make_router(*self.routings) return router(environ, start_response)
def route_child(self, environ, start_response): req = webob.Request(environ) ctx = contexts.Ctx(req) variable_name, error = conv.pipe( conv.cleanup_line, conv.not_none, )(req.urlvars.get('name'), state=ctx) child = self.child_from_node(ctx, unique_name=variable_name or u'') if error is not None: return wsgihelpers.not_found(ctx, body=child.render_not_found())( environ, start_response) return child.route(environ, start_response)