Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

tool_shed.metadata package

Submodules

tool_shed.metadata.metadata_generator module

class tool_shed.metadata.metadata_generator.MetadataGenerator(app, repository=None, changeset_revision=None, repository_clone_url=None, shed_config_dict=None, relative_install_dir=None, repository_files_dir=None, resetting_all_metadata_on_repository=False, updating_installed_repository=False, persist=False, metadata_dict=None, user=None)[source]

Bases: object

__init__(app, repository=None, changeset_revision=None, repository_clone_url=None, shed_config_dict=None, relative_install_dir=None, repository_files_dir=None, resetting_all_metadata_on_repository=False, updating_installed_repository=False, persist=False, metadata_dict=None, user=None)[source]
generate_data_manager_metadata(repo_dir, data_manager_config_filename, metadata_dict, shed_config_dict=None)[source]

Update the received metadata_dict with information from the parsed data_manager_config_filename.

generate_datatypes_metadata(tv, repository_files_dir, datatypes_config, metadata_dict)[source]

Update the received metadata_dict with information from the parsed datatypes_config.

generate_environment_dependency_metadata(elem, valid_tool_dependencies_dict)[source]

The value of env_var_name must match the value of the “set_environment” type in the tool config’s <requirements> tag set, or the tool dependency will be considered an orphan.

generate_guid_for_object(guid_type, obj_id, version)[source]
generate_metadata_for_changeset_revision()[source]

Generate metadata for a repository using its files on disk. To generate metadata for changeset revisions older than the repository tip, the repository will have been cloned to a temporary location and updated to a specified changeset revision to access that changeset revision’s disk files, so the value of self.repository_files_dir will not always be self.repository.repo_path( self.app ) (it could be an absolute path to a temporary directory containing a clone). If it is an absolute path, the value of self.relative_install_dir must contain repository.repo_path( self.app ).

The value of self.persist will be True when the installed repository contains a valid tool_data_table_conf.xml.sample file, in which case the entries should ultimately be persisted to the file referred to by self.app.config.shed_tool_data_table_config.

generate_package_dependency_metadata(elem, valid_tool_dependencies_dict, invalid_tool_dependencies_dict)[source]

Generate the metadata for a tool dependencies package defined for a repository. The value of package_name must match the value of the “package” type in the tool config’s <requirements> tag set.

generate_repository_dependency_metadata(repository_dependencies_config, metadata_dict)[source]

Generate a repository dependencies dictionary based on valid information defined in the received repository_dependencies_config. This method is called from the tool shed as well as from Galaxy.

generate_tool_metadata(tool_config, tool, metadata_dict)[source]

Update the received metadata_dict with changes that have been applied to the received tool.

generate_tool_dependency_metadata(tool_dependencies_config, metadata_dict, original_repository_metadata=None)[source]

If the combination of name, version and type of each element is defined in the <requirement> tag for at least one tool in self.repository, then update the received metadata_dict with information from the parsed tool_dependencies_config.

generate_workflow_metadata(relative_path, exported_workflow_dict, metadata_dict)[source]

Update the received metadata_dict with changes that have been applied to the received exported_workflow_dict.

get_invalid_file_tups()[source]
get_metadata_dict()[source]
get_relative_path_to_repository_file(root, name, relative_install_dir, work_dir, shed_config_dict)[source]
get_sample_files_from_disk(repository_files_dir, tool_path=None, relative_install_dir=None)[source]
handle_repository_elem(repository_elem, only_if_compiling_contained_td=False)[source]

Process the received repository_elem which is a <repository> tag either from a repository_dependencies.xml file or a tool_dependencies.xml file. If the former, we’re generating repository dependencies metadata for a repository in the Tool Shed. If the latter, we’re generating package dependency metadata within Galaxy or the Tool Shed.

set_add_to_tool_panel_attribute_for_tool(tool, guid, datatypes)[source]

Determine if a tool should be loaded into the Galaxy tool panel. Examples of valid tools that should not be displayed in the tool panel are datatypes converters and DataManager tools.

set_changeset_revision(changeset_revision)[source]
set_relative_install_dir(relative_install_dir)[source]
set_repository(repository, relative_install_dir=None, changeset_revision=None)[source]
set_repository_clone_url(repository_clone_url)[source]
set_repository_files_dir(repository_files_dir=None)[source]
update_repository_dependencies_metadata(metadata, repository_dependency_tups, is_valid, description)[source]

tool_shed.metadata.repository_metadata_manager module

class tool_shed.metadata.repository_metadata_manager.RepositoryMetadataManager(app, user, repository=None, changeset_revision=None, repository_clone_url=None, shed_config_dict=None, relative_install_dir=None, repository_files_dir=None, resetting_all_metadata_on_repository=False, updating_installed_repository=False, persist=False, metadata_dict=None)[source]

Bases: tool_shed.metadata.metadata_generator.MetadataGenerator

__init__(app, user, repository=None, changeset_revision=None, repository_clone_url=None, shed_config_dict=None, relative_install_dir=None, repository_files_dir=None, resetting_all_metadata_on_repository=False, updating_installed_repository=False, persist=False, metadata_dict=None)[source]
add_tool_versions(id, repository_metadata, changeset_revisions)[source]
build_repository_ids_select_field(name='repository_ids', multiple=True, display='checkboxes', my_writable=False)[source]

Generate the current list of repositories for resetting metadata.

clean_repository_metadata(changeset_revisions)[source]
compare_changeset_revisions(ancestor_changeset_revision, ancestor_metadata_dict)[source]

Compare the contents of two changeset revisions to determine if a new repository metadata revision should be created.

compare_data_manager(ancestor_metadata, current_metadata)[source]

Determine if ancestor_metadata is the same as or a subset of current_metadata for data_managers.

compare_datatypes(ancestor_datatypes, current_datatypes)[source]

Determine if ancestor_datatypes is the same as or a subset of current_datatypes.

compare_readme_files(ancestor_readme_files, current_readme_files)[source]

Determine if ancestor_readme_files is equal to or a subset of current_readme_files.

compare_repository_dependencies(ancestor_repository_dependencies, current_repository_dependencies)[source]

Determine if ancestor_repository_dependencies is the same as or a subset of current_repository_dependencies.

compare_tool_dependencies(ancestor_tool_dependencies, current_tool_dependencies)[source]

Determine if ancestor_tool_dependencies is the same as or a subset of current_tool_dependencies.

compare_workflows(ancestor_workflows, current_workflows)[source]

Determine if ancestor_workflows is the same as current_workflows or if ancestor_workflows is a subset of current_workflows.

create_or_update_repository_metadata(changeset_revision, metadata_dict)[source]

Create or update a repository_metadata record in the tool shed.

different_revision_defines_tip_only_repository_dependency(rd_tup, repository_dependencies)[source]

Determine if the only difference between rd_tup and a dependency definition in the list of repository_dependencies is the changeset_revision value.

get_parent_id(id, old_id, version, guid, changeset_revisions)[source]
get_query_for_setting_metadata_on_repositories(my_writable=False, order=True)[source]

Return a query containing repositories for resetting metadata. The order parameter is used for displaying the list of repositories ordered alphabetically for display on a page. When called from the Tool Shed API, order is False.

new_datatypes_metadata_required(repository_metadata)[source]

Compare the last saved metadata for each datatype in the repository with the new metadata in self.metadata_dict to determine if a new repository_metadata table record is required or if the last saved metadata record can be updated for datatypes instead.

new_metadata_required_for_utilities()[source]

This method compares the last stored repository_metadata record associated with self.repository against the contents of self.metadata_dict and returns True or False for the union set of Galaxy utilities contained in both metadata dictionaries. The metadata contained in self.metadata_dict may not be a subset of that contained in the last stored repository_metadata record associated with self.repository because one or more Galaxy utilities may have been deleted from self.repository in the new tip.

new_readme_files_metadata_required(repository_metadata)[source]

Compare the last saved metadata for each readme file in the repository with the new metadata in self.metadata_dict to determine if a new repository_metadata table record is required or if the last saved metadata record can be updated for readme files instead.

new_repository_dependency_metadata_required(repository_metadata)[source]

Compare the last saved metadata for each repository dependency in the repository with the new metadata in self.metadata_dict to determine if a new repository_metadata table record is required or if the last saved metadata record can be updated for repository_dependencies instead.

new_tool_metadata_required(repository_metadata)[source]

Compare the last saved metadata for each tool in the repository with the new metadata in self.metadata_dict to determine if a new repository_metadata table record is required, or if the last saved metadata record can be updated instead.

new_tool_dependency_metadata_required(repository_metadata)[source]

Compare the last saved metadata for each tool dependency in the repository with the new metadata in self.metadata_dict to determine if a new repository_metadata table record is required or if the last saved metadata record can be updated for tool_dependencies instead.

new_workflow_metadata_required(repository_metadata)[source]

Currently everything about an exported workflow except the name is hard-coded, so there’s no real way to differentiate versions of exported workflows. If this changes at some future time, this method should be enhanced accordingly.

reset_all_metadata_on_repository_in_tool_shed()[source]

Reset all metadata on a single repository in a tool shed.

reset_all_tool_versions(repo)[source]

Reset tool version lineage for those changeset revisions that include valid tools.

reset_metadata_on_selected_repositories(**kwd)[source]

Inspect the repository changelog to reset metadata for all appropriate changeset revisions. This method is called from both Galaxy and the Tool Shed.

set_repository(repository)[source]
set_repository_metadata(host, content_alert_str='', **kwd)[source]

Set metadata using the self.repository’s current disk files, returning specific error messages (if any) to alert the repository owner that the changeset has problems.

set_repository_metadata_due_to_new_tip(host, content_alert_str=None, **kwd)[source]

Set metadata on the tip of self.repository in the tool shed.