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

« back to all changes in this revision

Viewing changes to ivle/webapp/fileservice/__init__.py

  • Committer: Matt Giuca
  • Date: 2009-05-19 02:54:08 UTC
  • mfrom: (1258 trunk)
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: matt.giuca@gmail.com-20090519025408-19c7cjl7w6ot6frm
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
import os.path
32
32
 
33
 
import ivle.conf
34
33
import ivle.interpret
35
 
import ivle.util
36
34
from ivle.webapp.base.views import BaseView
37
35
from ivle.webapp.base.plugins import ViewPlugin
38
36
 
39
 
fileservice_path = os.path.join(ivle.conf.share_path, 'services/fileservice')
40
 
 
41
37
# XXX: Writes to req directly. This is a direct port of the legacy version.
42
38
#      This needs to be rewritten soon.
43
39
 
53
49
        """Handler for the File Services application."""
54
50
        if len(self.path) == 0:
55
51
            # If no path specified, default to the user's home directory
56
 
            req.throw_redirect(ivle.util.make_path(os.path.join('fileservice',
57
 
                                                           req.user.login)))
 
52
            req.throw_redirect(req.make_path(os.path.join('fileservice',
 
53
                                                          req.user.login)))
58
54
 
59
55
        interp_object = ivle.interpret.interpreter_objects["cgi-python"]
60
 
        user_jail_dir = os.path.join(ivle.conf.jail_base, req.user.login)
 
56
        user_jail_dir = os.path.join(req.config['paths']['jails']['mounts'],
 
57
                                     req.user.login)
 
58
 
61
59
        ivle.interpret.interpret_file(req, req.user, user_jail_dir,
62
 
            fileservice_path, interp_object, gentle=False)
 
60
                                  os.path.join(req.config['paths']['share'],
 
61
                                               'services/fileservice'),
 
62
                                  interp_object, gentle=False)
63
63
 
64
64
class Plugin(ViewPlugin):
65
65
    urls = [