mds_plugin/object_store.py
def format_pars_listing(pars):
    """Returns a formated list of pars.

    Args:
        pars (list): A list of PAR objects.

    Returns:
        The formated list as string
    """
    import re
    import math

    out = ""
    i = 1
    for p in pars:
        # Shorten to 30 chars max, remove linebreaks
        name = re.sub(r'[\n\r]', ' ',
                      p.name[:28] + '..'
                      if len(p.name) > 30
                      else p.name)
        obj_name = re.sub(r'[\n\r]', ' ',
                          p.object_name[:28] + '..'
                          if len(p.object_name) > 30
                          else p.object_name)
        time_cr = f"{p.time_created:%Y-%m-%d %H:%M}" \
            if p.time_created is not None else ""
        time_ex = f"{p.time_expires:%Y-%m-%d %H:%M}" \
            if p.time_expires is not None else ""

        out += (f"{i:>4} {name:30} {obj_name:30} {time_cr:16} {time_ex:16}\n")
        i += 1

    return out
Returns a formated list of pars.

    Args:
        pars (list): A list of PAR objects.

    Returns:
        The formated list as string
    
Returns a formated list of pars.
Returns a formated list of pars .
def format_pars_listing(pars):
    import re
    import math
    out = ""
    i = 1
    for p in pars:
        name = re.sub(r'[\n\r]', ' ',
                      p.name[:28] + '..'
                      if len(p.name) > 30
                      else p.name)
        obj_name = re.sub(r'[\n\r]', ' ',
                          p.object_name[:28] + '..'
                          if len(p.object_name) > 30
                          else p.object_name)
        time_cr = f"{p.time_created:%Y-%m-%d %H:%M}" \
            if p.time_created is not None else ""
        time_ex = f"{p.time_expires:%Y-%m-%d %H:%M}" \
            if p.time_expires is not None else ""
        out += (f"{i:>4} {name:30} {obj_name:30} {time_cr:16} {time_ex:16}\n")
        i += 1
    return out
def format_pars_listing ( pars ) : import re import math out = "" i = 1 for p in pars : name = re . sub ( r'[\n\r]' , ' ' , p . name [ : 28 ] + '..' if len ( p . name ) > 30 else p . name ) obj_name = re . sub ( r'[\n\r]' , ' ' , p . object_name [ : 28 ] + '..' if len ( p . object_name ) > 30 else p . object_name ) time_cr = f"{p.time_created:%Y-%m-%d %H:%M}" if p . time_created is not None else "" time_ex = f"{p.time_expires:%Y-%m-%d %H:%M}" if p . time_expires is not None else "" out += ( f"{i:>4} {name:30} {obj_name:30} {time_cr:16} {time_ex:16}\n" ) i += 1 return out
Returns a formated list of pars.
Returns a formated list of pars .
"""Returns a formated list of pars.

    Args:
        pars (list): A list of PAR objects.

    Returns:
        The formated list as string
    """ # Shorten to 30 chars max, remove linebreaks

The formated list as string
The formated list as string
pars
A list of PAR objects.
A list of PAR objects .