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_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_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.
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:
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]¶
- 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.
- 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_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.