1 from unfold.plugin import Plugin
3 # lists levels and sets them to enabled or not at startup
4 default_levels = {'fatal': True, 'error': True, 'warning' : True, 'info' : True, 'debug' : False}
6 class Messages (Plugin):
8 def __init__ (self, levels=None, **settings):
9 Plugin.__init__ (self, **settings)
10 if levels is None: levels=default_levels
11 # shortcut: 'ALL' turn everything on
12 elif levels=='ALL': levels=dict( [ (k,True) for k in default_levels ] )
13 elif levels=='NONE': levels=dict( [ (k,False) for k in default_levels ] )
16 def template_file (self):
17 return "messages.html"
19 def requirements (self):
21 'js_files' : [ "js/messages.js", "js/manifold.js", ],
22 'css_files' : "css/messages.css",
25 # although this has no query, we need a plugin instance to be created in the js output
26 def export_json_settings (self):
28 # the js plugin expects a domid
29 def json_settings_list (self):
30 return [ 'plugin_uuid', 'levels' ]
32 # and we don't need a spin wheel
33 def start_with_spin (self):