Added show_data()

This commit is contained in:
2Shirt 2019-10-02 22:25:54 -07:00
parent a2017fa415
commit e80a63ee51
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -877,6 +877,15 @@ def set_title(title):
print_error('Setting the title is only supported under Windows.')
def show_data(message, data, color=None):
"""Display info using standard WIDTH and INDENT."""
colors = (None, color if color else None)
print_colored(
(f'{" "*INDENT}{message:<{WIDTH}}', data),
colors,
)
def sleep(seconds=2):
"""Simple wrapper for time.sleep."""
time.sleep(seconds)