source: cows_wps/trunk/cows_wps/controllers/test.py @ 6898

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows_wps/trunk/cows_wps/controllers/test.py@6898
Revision 6898, 1.3 KB checked in by astephen, 10 years ago (diff)

many fixes

Line 
1import logging
2
3from pylons import request, response, session, tmpl_context as c
4from pylons.controllers.util import abort, redirect_to
5
6from cows_wps.renderer.ui_renderer import *
7from cows_wps.controllers import *
8from cows_wps.lib.ui.proc_config import *
9
10from cows_wps.utils.user_roles_dict import user_roles_config_dict
11
12log = logging.getLogger(__name__)
13
14
15class TestController(BaseController):
16
17    def index(self):
18        """
19        Shows a table of all procs.
20        """
21        try:
22            resp = str(user_roles_config_dict)
23        except Exception, err:
24            resp = str(err)
25
26               
27        return resp
28
29    def sess(self):
30        resp = str(session)
31        return resp
32
33    def REQUEST_METHOD(self):
34        return request.environ.get("REQUEST_METHOD")
35
36    def userid(self):
37        return str(request.environ)
38
39    def abort(self):
40        """405 Method Not Allowed
41    A request was made of a resource using a request method not supported by that resource;[2] for example, using GET on a form which requires data to be presented via POST, or using PUT on a read-only resource."""
42        return abort(405)
43
44    def filterpost(self):
45        if self.REQUEST_METHOD() == "POST":
46            return abort(405)
47        else:
48            return "Good request"
49
50    def secured(self):
51        return "Did you get asked for security info?"
Note: See TracBrowser for help on using the repository browser.