1
from ivle.webapp.base.plugins import ViewPlugin, OverlayPlugin, MediaPlugin
2
from ivle.webapp.console.service import ConsoleServiceRESTView
3
from ivle.webapp.console.overlay import ConsoleOverlay
4
from ivle.webapp.base.xhtml import XHTMLView
7
class ConsoleView(XHTMLView):
11
plugin_scripts = {'ivle.webapp.console': ['console.js']}
12
plugin_styles = {'ivle.webapp.console': ['console.css']}
13
plugin_scripts_init = ['console_init']
15
# Don't load the console overlay when we already have a console.
16
overlay_blacklist = [ConsoleOverlay]
18
def authorize(self, req):
19
return req.user is not None
21
def populate(self, req, ctx):
22
ctx['windowpane'] = False
23
ctx['start_body_attrs'] = {}
25
class Plugin(ViewPlugin, OverlayPlugin, MediaPlugin):
27
('console/service', ConsoleServiceRESTView),
28
('console', ConsoleView),
31
('console', 'Console', 'A Python console where you can try out code '
32
'without having to save and run it.', 'console.png', 'console', 3)
38
help = {'Console': 'help.html'}