Пример #1
0
def get_tool_panel_config_tool_path_install_dir(app, repository):
    """
    Return shed-related tool panel config, the tool_path configured in it, and the relative path to
    the directory where the repository is installed.  This method assumes all repository tools are
    defined in a single shed-related tool panel config.
    """
    tool_shed = common_util.remove_port_from_tool_shed_url(
        str(repository.tool_shed))
    relative_install_dir = '%s/repos/%s/%s/%s' % (
        tool_shed, str(repository.owner), str(
            repository.name), str(repository.installed_changeset_revision))
    # Get the relative tool installation paths from each of the shed tool configs.
    shed_config_dict = None
    if hasattr(repository, "get_shed_config_dict"):
        shed_config_dict = repository.get_shed_config_dict(app)
    if not shed_config_dict:
        # Just pick a semi-random shed config.
        for shed_config_dict in app.toolbox.dynamic_confs(
                include_migrated_tool_conf=True):
            if (repository.dist_to_shed and shed_config_dict['config_filename'] == app.config.migrated_tools_config) \
                    or (not repository.dist_to_shed and shed_config_dict['config_filename'] != app.config.migrated_tools_config):
                break
    shed_tool_conf = shed_config_dict['config_filename']
    tool_path = shed_config_dict['tool_path']
    return shed_tool_conf, tool_path, relative_install_dir
Пример #2
0
def get_tool_panel_config_tool_path_install_dir(app, repository):
    """
    Return shed-related tool panel config, the tool_path configured in it, and the relative path to
    the directory where the repository is installed.  This method assumes all repository tools are
    defined in a single shed-related tool panel config.
    """
    tool_shed = common_util.remove_port_from_tool_shed_url(
        str(repository.tool_shed))
    relative_install_dir = '%s/repos/%s/%s/%s' % (
        tool_shed, str(repository.owner), str(
            repository.name), str(repository.installed_changeset_revision))
    # Get the relative tool installation paths from each of the shed tool configs.
    shed_config_dict = repository.get_shed_config_dict(app)
    shed_tool_conf = shed_config_dict['config_filename']
    tool_path = shed_config_dict['tool_path']
    return shed_tool_conf, tool_path, relative_install_dir
Пример #3
0
def get_tool_panel_config_tool_path_install_dir(app, repository):
    """
    Return shed-related tool panel config, the tool_path configured in it, and the relative path to
    the directory where the repository is installed.  This method assumes all repository tools are
    defined in a single shed-related tool panel config.
    """
    tool_shed = common_util.remove_port_from_tool_shed_url(str(repository.tool_shed))
    relative_install_dir = '%s/repos/%s/%s/%s' % (tool_shed,
                                                  str(repository.owner),
                                                  str(repository.name),
                                                  str(repository.installed_changeset_revision))
    # Get the relative tool installation paths from each of the shed tool configs.
    shed_config_dict = repository.get_shed_config_dict(app)
    if not shed_config_dict:
        # Just pick a semi-random shed config.
        for shed_config_dict in app.toolbox.dynamic_confs(include_migrated_tool_conf=True):
            if (repository.dist_to_shed and shed_config_dict['config_filename'] == app.config.migrated_tools_config) \
                    or (not repository.dist_to_shed and shed_config_dict['config_filename'] != app.config.migrated_tools_config):
                break
    shed_tool_conf = shed_config_dict['config_filename']
    tool_path = shed_config_dict['tool_path']
    return shed_tool_conf, tool_path, relative_install_dir