commit/galaxy-central: 3 new changesets
3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/0fd4d60db4e2/ Changeset: 0fd4d60db4e2 User: jmchilton Date: 2014-08-05 04:47:36 Summary: Add get_api_key helper method to visualization templates. For use in the IPython visualization plugin - improves abstraction level and likely allows users who have never created a key to use IPython visualization. Affected #: 1 file diff -r a714f168aa7ddb1dfd3142f49869992cd325456c -r 0fd4d60db4e202d04fd42aa93c4af40c5d7b9748 lib/galaxy/visualization/registry.py --- a/lib/galaxy/visualization/registry.py +++ b/lib/galaxy/visualization/registry.py @@ -13,6 +13,7 @@ from galaxy.web import url_for from galaxy.web.base import pluginframework +from galaxy.managers import api_keys import logging log = logging.getLogger( __name__ ) @@ -338,6 +339,19 @@ config = self.resource_parser.parse_config( trans, controller, param_confs, query_dict ) return config + def fill_template( self, trans, plugin, template_filename, **kwargs ): + # TODO: As part of a future note plugin registry effort - move this + # override and let VisualizationsRegistry just revert to using parent's + # fill_template. + if 'get_api_key' not in kwargs: + + def get_api_key(): + return api_keys.ApiKeyManager( trans.app ).get_or_create_api_key( trans.user ) + + kwargs[ 'get_api_key' ] = get_api_key + + return super( VisualizationsRegistry, self ).fill_template( trans, plugin, template_filename, **kwargs ) + # ------------------------------------------------------------------- parsing the config file class ParsingException( ValueError ): https://bitbucket.org/galaxy/galaxy-central/commits/ddc9a669d53a/ Changeset: ddc9a669d53a User: jmchilton Date: 2014-08-05 04:47:36 Summary: Plugin framework: Expose plugin path to mako templates. Allows plugin templates to utilize resources contained in the plugin. Requested by Eric - should clean up IPython plugin somewhat. Affected #: 1 file diff -r 0fd4d60db4e202d04fd42aa93c4af40c5d7b9748 -r ddc9a669d53aa259d38efc882c890503444daaf5 lib/galaxy/web/base/pluginframework.py --- a/lib/galaxy/web/base/pluginframework.py +++ b/lib/galaxy/web/base/pluginframework.py @@ -588,6 +588,9 @@ ``plugin.template_path`` :returns: rendered template """ + if 'plugin_path' not in kwargs: + kwargs[ 'plugin_path'] = os.path.abspath( plugin.path ) + # defined here to be overridden return trans.fill_template( template_filename, template_lookup=plugin.template_lookup, **kwargs ) https://bitbucket.org/galaxy/galaxy-central/commits/33c032a19f9a/ Changeset: 33c032a19f9a User: dannon Date: 2014-08-05 16:33:09 Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #450) Plugin framework enhancements to improve galaxy-ipython. Affected #: 2 files diff -r 626c583781a1d6f2d550fb3c2c4b357f1f3d5273 -r 33c032a19f9af4549a5dfa7a55df7883117b4ea8 lib/galaxy/visualization/registry.py --- a/lib/galaxy/visualization/registry.py +++ b/lib/galaxy/visualization/registry.py @@ -13,6 +13,7 @@ from galaxy.web import url_for from galaxy.web.base import pluginframework +from galaxy.managers import api_keys import logging log = logging.getLogger( __name__ ) @@ -338,6 +339,19 @@ config = self.resource_parser.parse_config( trans, controller, param_confs, query_dict ) return config + def fill_template( self, trans, plugin, template_filename, **kwargs ): + # TODO: As part of a future note plugin registry effort - move this + # override and let VisualizationsRegistry just revert to using parent's + # fill_template. + if 'get_api_key' not in kwargs: + + def get_api_key(): + return api_keys.ApiKeyManager( trans.app ).get_or_create_api_key( trans.user ) + + kwargs[ 'get_api_key' ] = get_api_key + + return super( VisualizationsRegistry, self ).fill_template( trans, plugin, template_filename, **kwargs ) + # ------------------------------------------------------------------- parsing the config file class ParsingException( ValueError ): diff -r 626c583781a1d6f2d550fb3c2c4b357f1f3d5273 -r 33c032a19f9af4549a5dfa7a55df7883117b4ea8 lib/galaxy/web/base/pluginframework.py --- a/lib/galaxy/web/base/pluginframework.py +++ b/lib/galaxy/web/base/pluginframework.py @@ -588,6 +588,9 @@ ``plugin.template_path`` :returns: rendered template """ + if 'plugin_path' not in kwargs: + kwargs[ 'plugin_path'] = os.path.abspath( plugin.path ) + # defined here to be overridden return trans.fill_template( template_filename, template_lookup=plugin.template_lookup, **kwargs ) 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