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

« back to all changes in this revision

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

mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import cjson
23
23
import pysvn
24
24
 
25
 
import ivle.conf
26
25
import ivle.date
27
26
import ivle.interpret
28
27
from ivle.webapp.base.xhtml import XHTMLView
38
37
    def populate(self, req, ctx):
39
38
        self.plugin_styles[Plugin] = ['log.css']
40
39
 
41
 
        svnlogservice_path = os.path.join(ivle.conf.share_path,
 
40
        svnlogservice_path = os.path.join(req.config['paths']['share'],
42
41
                                          'services/svnlogservice')
43
42
 
44
 
        user_jail_dir = os.path.join(ivle.conf.jail_base, req.user.login)
 
43
        user_jail_dir = os.path.join(req.config['paths']['jails']['mounts'],
 
44
                                     req.user.login)
45
45
        (out, err) = ivle.interpret.execute_raw(req.user, user_jail_dir,
46
46
                             '/home', svnlogservice_path, [self.path])
47
47
        assert not err
56
56
 
57
57
        # No error. We must be safe.
58
58
        ctx['path'] = self.path
59
 
        ctx['url'] = ivle.util.make_path(os.path.join('svnlog', self.path))
 
59
        ctx['url'] = req.make_path(os.path.join('svnlog', self.path))
60
60
 
61
61
        sr = ivle.svn.revision_from_string(
62
62
                   req.get_fieldstorage().getfirst("r"))
69
69
        for log in ctx['logs']:
70
70
            log['date'] = ivle.date.make_date_nice(log['date'])
71
71
            for pathaction in log['paths']:
72
 
                pathaction.append(ivle.util.make_path(os.path.join('files',
 
72
                pathaction.append(req.make_path(os.path.join('files',
73
73
                                  ivle.util.split_path(req.path)[0],
74
74
                                  pathaction[0][1:])) + '?r=%d' % log['revno'])
75
75