~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/base/rest.py

Add tabs to the new framework. Move the app icons into the apps themselves.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# Author: Matt Giuca, Will Grant
19
19
 
20
20
import cgi
21
 
import urlparse
22
21
import inspect
23
22
 
24
23
import cjson
59
58
 
60
59
        if op._rest_api_permission not in self.get_permissions(req.user):
61
60
            raise Unauthorized()
62
 
    
63
 
    def convert_bool(self, value):
64
 
        if value in ('True', 'true', True):
65
 
            return True
66
 
        elif value in ('False', 'false', False):
67
 
            return False
68
 
        else:
69
 
            raise BadRequest()
70
61
 
71
62
    def render(self, req):
72
63
        if req.method not in self._allowed_methods:
96
87
        # POST implies named operation.
97
88
        elif req.method == 'POST':
98
89
            # TODO: Check Content-Type and implement multipart/form-data.
99
 
            data = req.read()
100
 
            opargs = dict(cgi.parse_qsl(data, keep_blank_values=1))
 
90
            opargs = dict(cgi.parse_qsl(req.read()))
101
91
            try:
102
92
                opname = opargs['ivle.op']
103
93
                del opargs['ivle.op']