示例#1
0
def print_module_list(source):
    """
    Prints the modules in the area of the repository specified by source.

    Args:
        source(str): Suffix of URL to list from
        area(str): Area of repository to list

    """
    split_list = vcs_git.get_server_repo_list()
    for module_path in split_list:
        if module_path.startswith(source + '/'):
            # Split module path by slashes twice and print what remains after that, i.e. after 'controls/<area>/'
            print(module_path.split('/', 2)[-1])
def get_area_module_list(area):
    """
    Get list of modules in a specified area of the repository.

    Args:
        area(str): Area of repository

    Returns:
        list of str: List of modules

    """

    repo_list = vcs_git.get_server_repo_list()

    modules = []
    for path in repo_list:
        if area in path and path.split('/')[-1] not in modules:
            modules.append(path.split('/')[-1])

    return modules