Esempio n. 1
0
 def __call__(self, environ, start_response):
     req = webob.Request(environ)
     req.session = environ["beaker.session"]
     provider = path_info_pop(environ)
     if provider not in self.config:
         return exc.HTTPNotFound()(environ, start_response)
     else:
         return self.config[provider](req)(environ, start_response)
Esempio n. 2
0
 def __call__(self, environ, start_response):
     req = webob.Request(environ)
     req.session = environ['beaker.session']
     provider = path_info_pop(environ)
     if provider == 'auth_info':
         return self.auth_info(req)(environ, start_response)
     if provider == 'dest_page':
         token = req.POST['token']
         data = self.store.retrieve(token)
         data = json.dumps(data)
         return webob.Response(content_type='text/plain',
                               body=data)(environ, start_response)
     if provider not in self.config:
         return exc.HTTPNotFound()(environ, start_response)
     else:
         return self.config[provider](req)(environ, start_response)
Esempio n. 3
0
 def __call__(self, environ, start_response):
     req = webob.Request(environ)
     req.session = environ['beaker.session']
     provider = path_info_pop(environ)
     if provider == 'auth_info':
         return self.auth_info(req)(environ, start_response)
     if provider == 'dest_page':
         token = req.POST['token']
         data = self.store.retrieve(token)
         data = json.dumps(data)
         return webob.Response(
             content_type='text/plain',
             body=data
         )(environ, start_response)
     if provider not in self.config:
         return exc.HTTPNotFound()(environ, start_response)
     else:
         return self.config[provider](req)(environ, start_response)
Esempio n. 4
0
 def __call__(self, request):
     provider = path_info_pop(request.environ).lower()
     if provider not in self.providers:
         return exc.HTTPNotFound()
     else:
         return self.providers[provider](request)
Esempio n. 5
0
 def __call__(self, request):
     provider = path_info_pop(request.environ).lower()
     if provider not in self.providers:
         return exc.HTTPNotFound()
     else:
         return self.providers[provider](request)