commit/galaxy-central: carlfeberhard: Visualization framework: add convenience mako base template
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/439fecf2f288/ Changeset: 439fecf2f288 User: carlfeberhard Date: 2013-08-06 23:30:05 Summary: Visualization framework: add convenience mako base template Affected #: 2 files diff -r e1b3dbeadb5051227f3ea216ea560f9b10bb29ed -r 439fecf2f288e776501807c229f54332e3b0fbdf config/plugins/visualizations/visualization_base.mako --- /dev/null +++ b/config/plugins/visualizations/visualization_base.mako @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +<% _=n_ %> + +%if embedded: + ${self.as_embedded()} +%else: + ${self.as_page()} +%endif + +## render this inside another page or via ajax +<%def name="as_embedded()"> + ${self.stylesheets()} + ${self.javascripts()} + ${self.get_body()} +</%def> + +## render this as it's own page +<%def name="as_page()"> +<!DOCTYPE HTML> +<html> + <head> + <title>${self.title()}</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + ${self.metas()} + ${self.stylesheets()} + ${self.javascripts()} + </head> + <body> + ${self.get_body()} + </body> +</html> +</%def> +##TODO: late_javascripts + +## Default body +<%def name="get_body()"></%def> + +## Default title +<%def name="title()">${visualization_name}</%def> + +## Additional metas can be defined by templates inheriting from this one. +<%def name="metas()"></%def> + +## Default stylesheets +<%def name="stylesheets()"> +${h.css('base')} +</%def> + +## Default javascripts +<%def name="javascripts()"> +${h.js( + "libs/jquery/jquery", + "libs/jquery/jquery.migrate" +)} + +<script type="text/javascript"> + // console protection + window.console = window.console || { + log : function(){}, + debug : function(){}, + info : function(){}, + warn : function(){}, + error : function(){}, + assert : function(){} + }; +</script> +</%def> diff -r e1b3dbeadb5051227f3ea216ea560f9b10bb29ed -r 439fecf2f288e776501807c229f54332e3b0fbdf lib/galaxy/visualization/registry.py --- a/lib/galaxy/visualization/registry.py +++ b/lib/galaxy/visualization/registry.py @@ -524,10 +524,14 @@ # test functions should be sent an object to test, and the parsed result expected from the test #TODO: currently, isinstance and string equivalance are the only test types supported - if test_type == 'isinstance': + if test_type == 'isinstance': #TODO: wish we could take this further but it would mean passing in the datatypes_registry test_fn = lambda o, result: isinstance( getter( o ), result ) + elif test_type == 'has_dataprovider': + test_fn = lambda o, result: ( hasattr( o, 'datatype' ) + and o.datatype.has_dataprovier( result ) ) + # default to simple (string) equilavance (coercing the test_attr to a string) else: test_fn = lambda o, result: str( getter( o ) ) == result Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org