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

« back to all changes in this revision

Viewing changes to ivle/webapp/console/service.py

  • Committer: William Grant
  • Date: 2010-07-03 11:15:42 UTC
  • mfrom: (1796.1.3 get-named-operations)
  • Revision ID: grantw@unimelb.edu.au-20100703111542-pc9odlk2bv4tj3rr
Named operations must now be declared as read_operation or write_operation. Read operations may be executed with a GET.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
import ivle.console
33
33
import ivle.chat
34
 
from ivle.webapp.base.rest import JSONRESTView, named_operation
 
34
from ivle.webapp.base.rest import JSONRESTView, write_operation
35
35
from ivle.webapp.errors import BadRequest
36
36
 
37
37
# XXX: Should be RPC view, with actions in URL?
43
43
        else:
44
44
            return set()
45
45
 
46
 
    @named_operation('use')
 
46
    @write_operation('use')
47
47
    def start(self, req, cwd=''):
48
48
        working_dir = os.path.join("/home", req.user.login, cwd)
49
49
 
58
58
                                     "port": cons.port,
59
59
                                     "magic": cons.magic}).encode('hex')}
60
60
 
61
 
    @named_operation('use')
 
61
    @write_operation('use')
62
62
    def chat(self, req, key, text='', cwd='', kind="chat"):
63
63
        # The request *should* have the following four fields:
64
64
        # key: Hex JSON dict of host and port where the console server lives,