Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[myslice.git] / plugins / univbristopo / __init__.py
1 from unfold.plugin import Plugin
2
3 class UnivbrisTopo(Plugin):
4     
5     def __init__ (self, query=None, **settings):
6         Plugin.__init__ (self, **settings)
7         self.query=query
8         self.query_uuid = query.query_uuid if query else None
9         print "called univbris topo plugin"
10
11     def template_file (self):
12         try:
13                 return "univbris_topology.html"
14         except:
15                 print "error template"
16
17     def requirements (self):
18         reqs = {
19             'js_files' : [ "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js",
20                            "js/manifold.js", "js/manifold-query.js", 
21                            "js/unfold-helper.js",
22                 'js/univbristopo.js', 'js/d3.v2.min.js','js/tooltip.topology.js',
23             ],
24             'css_files': [
25                 'css/univbris.css','css/tooltip.topology.css','css/tooltip.css','css/slice.topology.css', 
26             ]
27         }
28         return reqs
29
30     def json_settings_list (self):
31         # query_uuid will pass self.query results to the javascript
32         # and will be available as "record" in :
33         # on_new_record: function(record)
34         return ['plugin_uuid', 'domid', 'query_uuid','init_key',]
35
36     def export_json_settings (self):
37         return True