def __str__(self):
    if (not self.files):
        return 'No corresponding files found.'
    headers = ['Index', 'Filename']
    col_width = max((len(os.path.basename(file)) for file in self.files))
    format_row = f'{{:>{(len(headers[0]) + 2)}}}{{:>{(col_width + 2)}}}'
    terminal_size = ('─' * shutil.get_terminal_size().columns)
    return '\n'.join(('Corresponding files found:', ''.join((f'{{:>{(len(header) + 2)}}}'.format(header) for header in headers)), terminal_size, *(format_row.format(idx, os.path.basename(file)) for (idx, file) in enumerate(self.files))))
def __str__(self):
    if (not self.files):
        return 'No corresponding files found.'
    headers = ['Index', 'Filename']
    col_width = max((len(os.path.basename(file)) for file in self.files))
    format_row = f'{{:>{(len(headers[0]) + 2)}}}{{:>{(col_width + 2)}}}'
    terminal_size = ('─' * shutil.get_terminal_size().columns)
    return '\n'.join(('Corresponding files found:', .join((f'{{:>{(len(header) + 2)}}}'.format(header) for header in headers)), terminal_size, *(format_row.format(idx, os.path.basename(file)) for (idx, file) in enumerate(self.files))))