Commit 4e4f82c4 authored by Martin Matějek's avatar Martin Matějek

Minor cli output change

parent 709deaf2
......@@ -85,12 +85,15 @@ def print_templates(templates):
def list_notifications(notifications):
"""Pretty print stored notifications"""
print("Stored notifications:")
for k, v in notifications.items():
trimmed = ' '.join(v['message'][:80].split())
severity = v['metadata']['severity']
if not notifications:
print("No notifications found")
else:
print("Stored notifications:")
for k, v in notifications.items():
trimmed = ' '.join(v['message'][:80].split())
severity = v['metadata']['severity']
print("{} {}\t{}".format(print_severity(severity), k[:8], trimmed))
print("{} {}\t{}".format(print_severity(severity), k[:8], trimmed))
def print_notification(notification):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment