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

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/browser/__init__.py

  • Committer: William Grant
  • Date: 2009-04-28 06:39:38 UTC
  • Revision ID: grantw@unimelb.edu.au-20090428063938-9m60hweimymu3gdm
Use Request.make_path everywhere.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
import os.path
33
33
import cgi
34
34
 
35
 
from ivle import (util, studpath)
 
35
from ivle import studpath
36
36
import ivle.svn
37
37
 
38
38
class BrowserView(XHTMLView):
49
49
    def populate(self, req, ctx):
50
50
        if not hasattr(self, 'path'):
51
51
            # If no path specified, default to the user's home directory
52
 
            redirectPath = util.make_path(os.path.join('files', req.user.login))
53
 
            req.throw_redirect(util.make_path(redirectPath))
 
52
            redirectPath = req.make_path(os.path.join('files', req.user.login))
 
53
            req.throw_redirect(redirectPath)
54
54
 
55
55
        # Set request attributes
56
56
        self.plugin_styles[Plugin] = ['browser.css',
87
87
        # The page title should contain the name of the file being browsed
88
88
        ctx['title'] = self.path.rsplit('/', 1)[-1]
89
89
 
90
 
        ctx['fileservice_action'] = util.make_path(os.path.join("fileservice",
 
90
        ctx['fileservice_action'] = req.make_path(os.path.join("fileservice",
91
91
                                                                self.path))
92
92
        ctx['filename'] = cgi.escape(self.path)
93
93
 
94
94
    #TODO: Move all this logic into the template
95
95
    def gen_path(self, req, ctx):
96
96
 
97
 
        href_path = util.make_path('files')
 
97
        href_path = req.make_path('files')
98
98
        nav_path = ""
99
99
        revision = ivle.svn.revision_from_string(
100
100
                         req.get_fieldstorage().getfirst('r'))