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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2009-12-08 03:50:24 UTC
  • mfrom: (1294.2.143 ui-the-third)
  • Revision ID: grantw@unimelb.edu.au-20091208035024-wjx8zp54gth15ph8
Merge ui-the-third. This is another UI revamp.

The header is now thin! Thin! The yellow bar is gone. The tabs are gone.
Breadcrumbs are here. Routes is replaced (with an object publishing
mechanism). Views are less repetitive. etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
import ivle.interpret
34
34
from ivle.webapp.base.views import BaseView
35
35
from ivle.webapp.base.plugins import ViewPlugin
 
36
from ivle.webapp import ApplicationRoot
36
37
 
37
38
# XXX: Writes to req directly. This is a direct port of the legacy version.
38
39
#      This needs to be rewritten soon.
39
 
 
40
40
class FileserviceView(BaseView):
41
 
    def __init__(self, req, path):
42
 
        # XXX: Still depends on req.path internally.
43
 
        self.path = path
 
41
    subpath_allowed = True
44
42
 
45
43
    def authorize(self, req):
46
44
        return req.user is not None
61
59
                                               'services/fileservice'),
62
60
                                  interp_object, gentle=False)
63
61
 
 
62
    @property
 
63
    def path(self):
 
64
        return os.path.join(*self.subpath) if self.subpath else ''
 
65
 
64
66
class Plugin(ViewPlugin):
65
 
    urls = [
66
 
        ('fileservice/*path', FileserviceView),
67
 
        ('fileservice', FileserviceView, {'path': ''}),
68
 
    ]
 
67
    views = [(ApplicationRoot, 'fileservice', FileserviceView)]