def handle_sample_files_and_load_tool_from_tmp_config( self, repo, repository_id, changeset_revision, tool_config_filename, work_dir): tool = None message = '' ctx = hg_util.get_changectx_for_changeset(repo, changeset_revision) # We're not currently doing anything with the returned list of deleted_sample_files here. It is # intended to help handle sample files that are in the manifest, but have been deleted from disk. sample_files, deleted_sample_files = self.get_list_of_copied_sample_files( repo, ctx, dir=work_dir) if sample_files: self.app.config.tool_data_path = work_dir if 'tool_data_table_conf.xml.sample' in sample_files: # Load entries into the tool_data_tables if the tool requires them. tool_data_table_config = os.path.join( work_dir, 'tool_data_table_conf.xml') if tool_data_table_config: error, message = self.tdtm.handle_sample_tool_data_table_conf_file( tool_data_table_config, persist=False) if error: log.debug(message) manifest_ctx, ctx_file = hg_util.get_ctx_file_path_from_manifest( tool_config_filename, repo, changeset_revision) if manifest_ctx and ctx_file: tool, message2 = self.load_tool_from_tmp_config( repo, repository_id, manifest_ctx, ctx_file, work_dir) message = self.concat_messages(message, message2) return tool, message, sample_files
def handle_sample_files_and_load_tool_from_tmp_config( self, repo, repository_id, changeset_revision, tool_config_filename, work_dir ): tool = None message = "" ctx = hg_util.get_changectx_for_changeset(repo, changeset_revision) # We're not currently doing anything with the returned list of deleted_sample_files here. It is # intended to help handle sample files that are in the manifest, but have been deleted from disk. sample_files, deleted_sample_files = self.get_list_of_copied_sample_files(repo, ctx, dir=work_dir) if sample_files: self.app.config.tool_data_path = work_dir if "tool_data_table_conf.xml.sample" in sample_files: # Load entries into the tool_data_tables if the tool requires them. tool_data_table_config = os.path.join(work_dir, "tool_data_table_conf.xml") if tool_data_table_config: error, message = self.tdtm.handle_sample_tool_data_table_conf_file( tool_data_table_config, persist=False ) if error: log.debug(message) manifest_ctx, ctx_file = hg_util.get_ctx_file_path_from_manifest(tool_config_filename, repo, changeset_revision) if manifest_ctx and ctx_file: tool, message2 = self.load_tool_from_tmp_config(repo, repository_id, manifest_ctx, ctx_file, work_dir) message = self.concat_messages(message, message2) return tool, message, sample_files