'Determine the path to the installation directory for each of the received
tool dependencies.  This path will be displayed within the tool dependencies
container on the select_tool_panel_section or reselect_tool_panel_section
pages when installing or reinstalling repositories that contain tools with
the defined tool dependencies.  The list of tool dependencies may be associated
with more than a single repository.'

def add_installation_directories_to_tool_dependencies(self, tool_dependencies):

    for (dependency_key, requirements_dict) in tool_dependencies.items():
        if (dependency_key in ['set_environment']):
            continue
        repository_name = requirements_dict.get('repository_name', 'unknown')
        repository_owner = requirements_dict.get('repository_owner', 'unknown')
        changeset_revision = requirements_dict.get('changeset_revision', 'unknown')
        dependency_name = requirements_dict['name']
        version = requirements_dict['version']
        if self.app.config.tool_dependency_dir:
            root_dir = self.app.config.tool_dependency_dir
        else:
            root_dir = '<set    your    tool_dependency_dir    in    your    Galaxy    configuration    file>'
        install_dir = os.path.join(root_dir, dependency_name, version, repository_owner, repository_name, changeset_revision)
        requirements_dict['install_dir'] = install_dir
        tool_dependencies[dependency_key] = requirements_dict
    return tool_dependencies
