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

« back to all changes in this revision

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

  • Committer: David Coles
  • Date: 2009-12-08 02:10:26 UTC
  • Revision ID: coles.david@gmail.com-20091208021026-3a27ecdzm49y39me
Configuration documentation - fixing a few references

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
# XXX: Should be RPC view, with actions in URL?
38
38
class ConsoleServiceRESTView(JSONRESTView):
39
39
    '''An RPC interface to a Python console.'''
40
 
    def get_permissions(self, user, config):
 
40
    def get_permissions(self, user):
41
41
        if user is not None:
42
42
            return set(['use'])
43
43
        else:
87
87
 
88
88
        msg = {'cmd':kind, 'text':text}
89
89
        try:
 
90
            json_response = ivle.chat.chat(host, port, msg, magic,decode=False)
 
91
 
 
92
            # Snoop the response from python-console to check that it's valid
90
93
            try:
91
 
                json_response = ivle.chat.chat(host, port, msg, magic,decode=False)
92
 
                # Snoop the response from python-console to check that it's valid
93
94
                response = cjson.decode(json_response)
94
 
            except (cjson.DecodeError, ivle.chat.ProtocolError):
 
95
            except cjson.DecodeError:
95
96
                # Could not decode the reply from the python-console server
96
97
                response = {"terminate":
97
98
                    "Communication to console process lost"}