mrs_plugin/services.py
def format_service_listing(services, print_header=False):
    """Formats the listing of MRS services

    Args:
        services (list): A list of services as dicts
        print_header (bool): If set to true, a header is printed


    Returns:
        The formated list of services
    """

    if print_header:
        output = (f"{'ID':>3} {'PATH':25} {'ENABLED':8} {'PROTOCOL(s)':20} "
                  f"{'DEFAULT':9}\n")
    else:
        output = ""

    i = 0
    for item in services:
        i += 1
        url = item.get('url_host_name') + item.get('url_context_root')
        output += (f"{item['id']:>3} {url[:24]:25} "
                   f"{'Yes' if item['enabled'] else '-':8} "
                   f"{item['url_protocol'][:19]:20} "
                   f"{'Yes' if item['is_default'] else '-':5}")
        if i < len(services):
            output += "\n"

    return output
Formats the listing of MRS services

    Args:
        services (list): A list of services as dicts
        print_header (bool): If set to true, a header is printed


    Returns:
        The formated list of services
    
Formats the listing of MRS services
Formats the listing of MRS services
def format_service_listing(services, print_header=False):
    if print_header:
        output = (f"{'ID':>3} {'PATH':25} {'ENABLED':8} {'PROTOCOL(s)':20} "
                  f"{'DEFAULT':9}\n")
    else:
        output = ""
    i = 0
    for item in services:
        i += 1
        url = item.get('url_host_name') + item.get('url_context_root')
        output += (f"{item['id']:>3} {url[:24]:25} "
                   f"{'Yes' if item['enabled'] else '-':8} "
                   f"{item['url_protocol'][:19]:20} "
                   f"{'Yes' if item['is_default'] else '-':5}")
        if i < len(services):
            output += "\n"
    return output
def format_service_listing ( services , print_header = False ) : if print_header : output = ( f"{'ID':>3} {'PATH':25} {'ENABLED':8} {'PROTOCOL(s)':20} " f"{'DEFAULT':9}\n" ) else : output = "" i = 0 for item in services : i += 1 url = item . get ( 'url_host_name' ) + item . get ( 'url_context_root' ) output += ( f"{item['id']:>3} {url[:24]:25} " f"{'Yes' if item['enabled'] else '-':8} " f"{item['url_protocol'][:19]:20} " f"{'Yes' if item['is_default'] else '-':5}" ) if i < len ( services ) : output += "\n" return output
Formats the listing of MRS services
Formats the listing of MRS services
"""Formats the listing of MRS services

    Args:
        services (list): A list of services as dicts
        print_header (bool): If set to true, a header is printed


    Returns:
        The formated list of services
    """
The formated list of services
The formated list of services
services
A list of services as dicts
A list of services as dicts
print_header
If set to true, a header is printed
If set to true a header is printed