commit/galaxy-central: greg: Make sure dymanically generated select list options exist before checking for missing dependencies.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/dc4a8297d0ab/ changeset: dc4a8297d0ab user: greg date: 2011-09-23 19:51:55 summary: Make sure dymanically generated select list options exist before checking for missing dependencies. affected #: 3 files (-1 bytes) --- a/lib/galaxy/web/base/controller.py Fri Sep 23 13:49:33 2011 -0400 +++ b/lib/galaxy/web/base/controller.py Fri Sep 23 13:51:55 2011 -0400 @@ -2447,23 +2447,24 @@ # If the tool refers to .loc files or requires an entry in the # tool_data_table_conf.xml, make sure all requirements exist. options = input_param.dynamic_options or input_param.options - if options.missing_tool_data_table_name: - # The repository must contain a tool_data_table_conf.xml.sample file. - for sample_file in sample_files: - head, tail = os.path.split( sample_file ) - if tail == 'tool_data_table_conf.xml.sample': - error, correction_msg = handle_sample_tool_data_table_conf_file( trans, sample_file ) - if error: - log.debug( exception_msg ) - break - if options.missing_index_file: - missing_head, missing_tail = os.path.split( options.missing_index_file ) - # The repository must contain the required xxx.loc.sample file. - for sample_file in sample_files: - sample_head, sample_tail = os.path.split( sample_file ) - if sample_tail == '%s.sample' % missing_tail: - copy_sample_loc_file( trans, sample_file ) - break + if options: + if options.missing_tool_data_table_name: + # The repository must contain a tool_data_table_conf.xml.sample file. + for sample_file in sample_files: + head, tail = os.path.split( sample_file ) + if tail == 'tool_data_table_conf.xml.sample': + error, correction_msg = handle_sample_tool_data_table_conf_file( trans, sample_file ) + if error: + log.debug( exception_msg ) + break + if options.missing_index_file: + missing_head, missing_tail = os.path.split( options.missing_index_file ) + # The repository must contain the required xxx.loc.sample file. + for sample_file in sample_files: + sample_head, sample_tail = os.path.split( sample_file ) + if sample_tail == '%s.sample' % missing_tail: + copy_sample_loc_file( trans, sample_file ) + break # At this point, we need to lstrip tool_path from relative_path. tup_path = relative_path.replace( tool_path, '' ).lstrip( '/' ) repository_tools_tups.append( ( tup_path, repository_tool ) ) --- a/lib/galaxy/webapps/community/controllers/common.py Fri Sep 23 13:49:33 2011 -0400 +++ b/lib/galaxy/webapps/community/controllers/common.py Fri Sep 23 13:51:55 2011 -0400 @@ -175,39 +175,40 @@ # If the tool refers to .loc files or requires an entry in the # tool_data_table_conf.xml, make sure all requirements exist. options = input_param.dynamic_options or input_param.options - if options.missing_tool_data_table_name: - # See if the repository contains a tool_data_table_conf.xml.sample file. - sample_found = False - for sample_file in sample_files: - head, tail = os.path.split( sample_file ) - if tail == 'tool_data_table_conf.xml.sample': - sample_found = True - error, correction_msg = handle_sample_tool_data_table_conf_file( trans, sample_file ) - if error: - can_set_metadata = False - invalid_files.append( ( tail, correction_msg ) ) - break - if not sample_found: - can_set_metadata = False - correction_msg = "This file requires an entry in the tool_data_table_conf.xml file. " - correction_msg += "Upload a file named tool_data_table_conf.xml.sample to the repository " - correction_msg += "that includes the required entry to resolve this issue.<br/>" - invalid_files.append( ( name, correction_msg ) ) - elif options.missing_index_file: - missing_head, missing_tail = os.path.split( options.missing_index_file ) - # See if the repository contains the required xxx.loc.sample file. - sample_found = False - for sample_file in sample_files: - sample_head, sample_tail = os.path.split( sample_file ) - if sample_tail == '%s.sample' % missing_tail: - copy_sample_loc_file( trans, sample_file ) - sample_found = True - break - if not sample_found: - can_set_metadata = False - correction_msg = "This file refers to a missing file <b>%s</b>. " % str( options.missing_index_file ) - correction_msg += "Upload a file named <b>%s.sample</b> to the repository to correct this error." % str( missing_tail ) - invalid_files.append( ( name, correction_msg ) ) + if options: + if options.missing_tool_data_table_name: + # See if the repository contains a tool_data_table_conf.xml.sample file. + sample_found = False + for sample_file in sample_files: + head, tail = os.path.split( sample_file ) + if tail == 'tool_data_table_conf.xml.sample': + sample_found = True + error, correction_msg = handle_sample_tool_data_table_conf_file( trans, sample_file ) + if error: + can_set_metadata = False + invalid_files.append( ( tail, correction_msg ) ) + break + if not sample_found: + can_set_metadata = False + correction_msg = "This file requires an entry in the tool_data_table_conf.xml file. " + correction_msg += "Upload a file named tool_data_table_conf.xml.sample to the repository " + correction_msg += "that includes the required entry to resolve this issue.<br/>" + invalid_files.append( ( name, correction_msg ) ) + elif options.missing_index_file: + missing_head, missing_tail = os.path.split( options.missing_index_file ) + # See if the repository contains the required xxx.loc.sample file. + sample_found = False + for sample_file in sample_files: + sample_head, sample_tail = os.path.split( sample_file ) + if sample_tail == '%s.sample' % missing_tail: + copy_sample_loc_file( trans, sample_file ) + sample_found = True + break + if not sample_found: + can_set_metadata = False + correction_msg = "This file refers to a missing file <b>%s</b>. " % str( options.missing_index_file ) + correction_msg += "Upload a file named <b>%s.sample</b> to the repository to correct this error." % str( missing_tail ) + invalid_files.append( ( name, correction_msg ) ) return can_set_metadata, invalid_files def generate_tool_metadata( trans, id, changeset_revision, tool_config, tool, metadata_dict ): """ --- a/templates/tool_form.mako Fri Sep 23 13:49:33 2011 -0400 +++ b/templates/tool_form.mako Fri Sep 23 13:51:55 2011 -0400 @@ -257,12 +257,13 @@ # If the tool refers to .loc files or requires an entry in the # tool_data_table_conf.xml, make sure all requirements exist. options = input_param.dynamic_options or input_param.options - if options.missing_tool_data_table_name: - message = "Data table named '%s' is required by tool but not configured" % options.missing_tool_data_table_name - break - if options.missing_index_file: - message = "Index file named '%s' is required by tool but not availble" % options.missing_index_file - break + if options: + if options.missing_tool_data_table_name: + message = "Data table named '%s' is required by tool but not configured" % options.missing_tool_data_table_name + break + if options.missing_index_file: + message = "Index file named '%s' is required by tool but not availble" % options.missing_index_file + break # Handle calculating the redirect url for the special case where we have nginx proxy # upload and need to do url_for on the redirect portion of the tool action. 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