Пример #1
0
 def debug(self, environ, start_response):
     assert request.path_info_pop(environ) == '_debug'
     next_part = request.path_info_pop(environ)
     method = getattr(self, next_part, None)
     if not method:
         exc = httpexceptions.HTTPNotFound(
             '%r not found when parsing %r' %
             (next_part, wsgilib.construct_url(environ)))
         return exc.wsgi_application(environ, start_response)
     if not getattr(method, 'exposed', False):
         exc = httpexceptions.HTTPForbidden('%r not allowed' % next_part)
         return exc.wsgi_application(environ, start_response)
     return method(environ, start_response)
Пример #2
0
 def debug(self, environ, start_response):
     assert request.path_info_pop(environ) == '_debug'
     next_part = request.path_info_pop(environ)
     method = getattr(self, next_part, None)
     if not method:
         exc = httpexceptions.HTTPNotFound(
             '%r not found when parsing %r'
             % (next_part, wsgilib.construct_url(environ)))
         return exc.wsgi_application(environ, start_response)
     if not getattr(method, 'exposed', False):
         exc = httpexceptions.HTTPForbidden(
             '%r not allowed' % next_part)
         return exc.wsgi_application(environ, start_response)
     return method(environ, start_response)