List of testbeds based on the resources all_query
[unfold.git] / plugins / testbeds / __init__.py
1 from unfold.plugin import Plugin
2
3 class TestbedsPlugin(Plugin):
4     
5     def __init__ (self, query=None, query_all=None, query_network=None, **settings):
6         Plugin.__init__ (self, **settings)
7
8         # Until we have a proper way to access queries in Python
9         self.query              = query
10         self.query_all          = query_all
11         self.query_all_uuid     = query_all.query_uuid if query_all else None
12
13     def template_file (self):
14         return "testbeds.html"
15
16     def requirements (self):
17         reqs = {
18             'js_files' : [
19                 'js/testbeds.js'
20             ],
21 #            'css_files': [
22 #                'css/myplugin.css',
23 #            ]
24         }
25         return reqs
26
27     def json_settings_list (self):
28         # query_uuid will pass self.query results to the javascript
29         # and will be available as "record" in :
30         # on_new_record: function(record)
31         return ['plugin_uuid', 'domid', 'query_uuid', 'query_all_uuid']
32
33     def export_json_settings (self):
34         return True