commit/galaxy-central: greg: Add a guid to tool shed repository tool metadata and add some fixes for previewing tool shed repository tools.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/e08716dfa2d5/ changeset: e08716dfa2d5 user: greg date: 2011-08-29 17:29:31 summary: Add a guid to tool shed repository tool metadata and add some fixes for previewing tool shed repository tools. affected #: 5 files (1.6 KB) --- a/lib/galaxy/webapps/community/app.py Mon Aug 29 11:22:54 2011 -0400 +++ b/lib/galaxy/webapps/community/app.py Mon Aug 29 11:29:31 2011 -0400 @@ -13,6 +13,8 @@ self.config = config.Configuration( **kwargs ) self.config.check() config.configure_logging( self.config ) + # Set up datatypes registry + self.datatypes_registry = galaxy.datatypes.registry.Registry( self.config.root, self.config.datatypes_config ) # Determine the database url if self.config.database_connection: db_url = self.config.database_connection --- a/lib/galaxy/webapps/community/config.py Mon Aug 29 11:22:54 2011 -0400 +++ b/lib/galaxy/webapps/community/config.py Mon Aug 29 11:29:31 2011 -0400 @@ -39,11 +39,21 @@ self.file_path = resolve_path( kwargs.get( "file_path", "database/files" ), self.root ) self.new_file_path = resolve_path( kwargs.get( "new_file_path", "database/tmp" ), self.root ) self.cookie_path = kwargs.get( "cookie_path", "/" ) + self.datatypes_config = kwargs.get( 'datatypes_config_file', 'datatypes_conf.xml' ) self.test_conf = resolve_path( kwargs.get( "test_conf", "" ), self.root ) self.id_secret = kwargs.get( "id_secret", "USING THE DEFAULT IS NOT SECURE!" ) + # Tool stuff self.tool_secret = kwargs.get( "tool_secret", "" ) self.tool_data_path = resolve_path( kwargs.get( "tool_data_path", "tool-data" ), os.getcwd() ) self.tool_data_table_config_path = resolve_path( kwargs.get( 'tool_data_table_config_path', 'tool_data_table_conf.xml' ), self.root ) + self.ftp_upload_dir = kwargs.get( 'ftp_upload_dir', None ) + # Location for dependencies + if 'tool_dependency_dir' in kwargs: + self.tool_dependency_dir = resolve_path( kwargs.get( "tool_dependency_dir" ), self.root ) + self.use_tool_dependencies = True + else: + self.tool_dependency_dir = None + self.use_tool_dependencies = False self.use_remote_user = string_as_bool( kwargs.get( "use_remote_user", "False" ) ) self.remote_user_maildomain = kwargs.get( "remote_user_maildomain", None ) self.remote_user_logout_href = kwargs.get( "remote_user_logout_href", None ) --- a/lib/galaxy/webapps/community/controllers/common.py Mon Aug 29 11:22:54 2011 -0400 +++ b/lib/galaxy/webapps/community/controllers/common.py Mon Aug 29 11:29:31 2011 -0400 @@ -145,11 +145,22 @@ # The received metadata_dict includes no metadata for workflows, so a new repository_metadata table # record is not needed. return False +def generate_tool_guid( trans, repository, tool ): + """ + Generate a guid for the received tool. The form of the guid is + <tool shed host>/repos/<tool shed username>/<tool shed repo name>/<tool id>/<tool version> + """ + return '%s/repos/%s/%s/%s/%s' % ( trans.request.host, + repository.user.username, + repository.name, + tool.id, + tool.version ) def generate_tool_metadata( trans, id, changeset_revision, root, name, tool, metadata_dict ): """ Update the received metadata_dict with changes that have been applied to the received tool. """ + repository = get_repository( trans, id ) tool_requirements = [] for tr in tool.requirements: requirement_dict = dict( name=tr.name, @@ -165,6 +176,7 @@ outputs=ttb.outputs ) tool_tests.append( test_dict ) tool_dict = dict( id=tool.id, + guid = generate_tool_guid( trans, repository, tool ), name=tool.name, version=tool.version, description=tool.description, --- a/templates/webapps/community/repository/tool_form.mako Mon Aug 29 11:22:54 2011 -0400 +++ b/templates/webapps/community/repository/tool_form.mako Mon Aug 29 11:29:31 2011 -0400 @@ -4,7 +4,7 @@ <% from galaxy.util.expressions import ExpressionContext from galaxy import util - from galaxy.tools.parameters.basic import DataToolParameter, ColumnListParameter, SelectToolParameter + from galaxy.tools.parameters.basic import DataToolParameter, ColumnListParameter, GenomeBuildParameter, SelectToolParameter from galaxy.web.form_builder import SelectField is_admin = trans.user_is_admin() @@ -60,8 +60,8 @@ %endif %elif input.type == "upload_dataset": %if input.get_datatype( trans, other_values ).composite_type is None: - # Have non-composite upload appear as before - ${do_inputs( input.inputs, tool_state[input.name][0], prefix + input.name + "_" + str( 0 ) + "|", other_values )} + ## Have non-composite upload appear as before + ${do_inputs( input.inputs, 'files', prefix + input.name + "_" + str( 0 ) + "|", other_values )} %else: <div class="repeat-group"><div class="form-title-row"> @@ -82,7 +82,7 @@ <%def name="row_for_param( prefix, param, parent_state, other_values )"><% label = param.get_label() - if isinstance( param, DataToolParameter ) or isinstance( param, ColumnListParameter ): + if isinstance( param, DataToolParameter ) or isinstance( param, ColumnListParameter ) or isinstance( param, GenomeBuildParameter ): field = SelectField( param.name ) field.add_option( param.name, param.name ) field_html = field.get_html() --- a/templates/webapps/community/repository/view_tool_metadata.mako Mon Aug 29 11:22:54 2011 -0400 +++ b/templates/webapps/community/repository/view_tool_metadata.mako Mon Aug 29 11:29:31 2011 -0400 @@ -137,6 +137,13 @@ <div style="clear: both"></div></div> %endif + %if 'guid' in metadata: + <div class="form-row"> + <label>Guid:</label> + ${metadata[ 'guid' ]} + <div style="clear: both"></div> + </div> + %endif %if 'version' in metadata: <div class="form-row"><label>Version:</label> 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)
-
Bitbucket