mds_plugin/object_store.py
def format_bucket_objects_listing(bucket_objects):
    """Returns a formated list of buckets.

    Args:
        buckets (list): A list of buckets objects.

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

    out = ""
    i = 1
    for o in bucket_objects:
        # Shorten to 24 chars max, remove linebreaks
        name = re.sub(r'[\n\r]', ' ',
                      o.name[:63] + '..'
                      if len(o.name) > 65
                      else o.name)
        size = sizeof_fmt(o.size)
        time = f"{o.time_modified:%Y-%m-%d %H:%M}" \
            if o.time_modified is not None else ""

        out += (f"{i:>4} {name:65} {size:8} {time:16}\n")
        i += 1

    return out
Returns a formated list of buckets.

    Args:
        buckets (list): A list of buckets objects.

    Returns:
        The formated list as string
    
Returns a formated list of buckets.
Returns a formated list of buckets .
def format_bucket_objects_listing(bucket_objects):
    import re
    import math
    out = ""
    i = 1
    for o in bucket_objects:
        name = re.sub(r'[\n\r]', ' ',
                      o.name[:63] + '..'
                      if len(o.name) > 65
                      else o.name)
        size = sizeof_fmt(o.size)
        time = f"{o.time_modified:%Y-%m-%d %H:%M}" \
            if o.time_modified is not None else ""
        out += (f"{i:>4} {name:65} {size:8} {time:16}\n")
        i += 1
    return out
def format_bucket_objects_listing ( bucket_objects ) : import re import math out = "" i = 1 for o in bucket_objects : name = re . sub ( r'[\n\r]' , ' ' , o . name [ : 63 ] + '..' if len ( o . name ) > 65 else o . name ) size = sizeof_fmt ( o . size ) time = f"{o.time_modified:%Y-%m-%d %H:%M}" if o . time_modified is not None else "" out += ( f"{i:>4} {name:65} {size:8} {time:16}\n" ) i += 1 return out
Returns a formated list of buckets.
Returns a formated list of buckets .
"""Returns a formated list of buckets.

    Args:
        buckets (list): A list of buckets objects.

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

The formated list as string
The formated list as string
bucket_objects
buckets
A list of buckets objects.
A list of buckets objects .