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

« back to all changes in this revision

Viewing changes to www/apps/server/__init__.py

  • Committer: mattgiuca
  • Date: 2008-02-05 07:13:40 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:420
common.interpret: Changed interface (refactor).
Used to accept absolute filename, and then basically ignored this and looked
in req.path (extremely bad encapsulation). Now does not look in req.path.
Instead accepts jail dir and filename RELATIVE to jail as args. This means it
does not have to figure out the jail itself.

This is necessary to make it possible to interpret scripts which aren't
student scripts.

server: Changed call to common.interpret.interpret_file to match. Now server
calculates the jail directory as an argument.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        try:
91
91
            # Get the interpreter function object
92
92
            interp_object = interpret.interpreter_objects[interp_name]
 
93
            (_, jail_dir, path) = studpath.url_to_jailpaths(req.path)
93
94
        except KeyError:
94
95
            # TODO: Nicer 500 message (this is due to bad configuration in
95
96
            # conf/app/server.py)
96
97
            req.throw_error(req.HTTP_INTERNAL_SERVER_ERROR)
97
 
        interpret.interpret_file(req, owner, filename, interp_object)
 
98
        interpret.interpret_file(req, owner, jail_dir, path, interp_object)
98
99
 
99
100
    else:
100
101
        # Otherwise, use the blacklist/whitelist to see if this file should be