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

« back to all changes in this revision

Viewing changes to ivle/webapp/media.py

Dispatch now generates an index for each plugin type, allowing plugins to
be written which are aware of other plugins, and other plugin types.

All view plugins now subclass from ivle.webapp.base.plugins.ViewPlugin,
as opposed to subclassing BasePlugin directly. This will allow us to
easily re-write console as an OverlayPlugin, and allow future new
plugins types to be created.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import ivle.conf
27
27
from ivle.webapp.base.views import BaseView
28
 
from ivle.webapp.base.plugins import BasePlugin
 
28
from ivle.webapp.base.plugins import ViewPlugin
29
29
from ivle.webapp.errors import NotFound
30
30
 
31
31
def media_url(req, plugin, path):
83
83
        req.content_type = type
84
84
        req.sendfile(filename)
85
85
 
86
 
class Plugin(BasePlugin):
 
86
class Plugin(ViewPlugin):
87
87
    urls = [
88
88
        ('+media/:ns/*path', MediaFileView),
89
89
    ]