Beispiel #1
0
def list_env_specs(project_dir):
    """List environments in the project."""
    project = load_project(project_dir)
    if console_utils.print_project_problems(project):
        return 1
    print("Environments for project: {}\n".format(project_dir))
    console_utils.print_names_and_descriptions(project.env_specs.values())
    return 0
Beispiel #2
0
def list_variables(project_dir, env_spec_name):
    """List variables present in project."""
    project = load_project(project_dir)
    if console_utils.print_project_problems(project):
        return 1
    print("Variables for project: {}\n".format(project_dir))
    console_utils.print_names_and_descriptions(project.all_variable_requirements(env_spec_name), name_attr='env_var')
    return 0
Beispiel #3
0
def list_downloads(project_dir, env_spec_name):
    """List the downloads present in project."""
    project = load_project(project_dir)
    if console_utils.print_project_problems(project):
        return 1

    if project.downloads(env_spec_name):
        print("Downloads for project: {}\n".format(project_dir))
        console_utils.print_names_and_descriptions(project.download_requirements(env_spec_name), name_attr='title')
    else:
        print("No downloads found in project.")
    return 0
def list_services(project_dir, env_spec_name):
    """List the services listed on the project."""
    project = load_project(project_dir)
    if console_utils.print_project_problems(project):
        return 1

    if project.services(env_spec_name):
        print("Services for project: {}\n".format(project_dir))
        console_utils.print_names_and_descriptions(project.service_requirements(env_spec_name), name_attr='title')
    else:
        print("No services found for project: {}".format(project_dir))
    return 0
Beispiel #5
0
def list_commands(project_dir):
    """List the commands on the project.

    Returns:
        int exit code
    """
    project = load_project(project_dir)
    if console_utils.print_project_problems(project):
        return 1

    if project.commands:
        print("Commands for project: {}\n".format(project_dir))
        console_utils.print_names_and_descriptions(project.commands.values())
    else:
        print("No commands found for project: {}\n".format(project_dir))
    return 0