~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: 2010-07-27 04:52:14 UTC
  • Revision ID: coles.david@gmail.com-20100727045214-p32h1kc0gcv48dpr
Worksheets: Strip off whitespace from the end of exercise attempts.

This solves an issue where accidental whitespace in an attempt will cause 
"IndentationError" syntax error (which don't occur when run in console).

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,