Extract print_divider

This commit is contained in:
Ivan Habunek 2023-12-07 10:06:39 +01:00
parent bf5eb9e7f8
commit a4cf678b15
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
1 changed files with 9 additions and 8 deletions

View File

@ -258,11 +258,10 @@ def poll_lines(poll: Poll) -> Generator[str, None, None]:
def print_timeline(items: Iterable[Status]):
width = get_width()
click.echo("" * width)
print_divider()
for item in items:
print_status(item)
click.echo("" * width)
print_divider()
notification_msgs = {
@ -274,19 +273,17 @@ notification_msgs = {
def print_notification(notification: Notification):
width = get_width()
print_notification_header(notification)
if notification.status:
click.echo("-" * width)
print_divider(char="-")
print_status(notification.status)
def print_notifications(notifications: List[Notification]):
width = get_width()
for notification in notifications:
click.echo("" * width)
print_divider()
print_notification(notification)
click.echo("" * width)
print_divider()
def print_notification_header(notification: Notification):
@ -315,6 +312,10 @@ notification_msgs = {
}
def print_divider(char: str = ""):
click.echo(char * get_width())
def format_tag_name(tag):
return green(f"#{tag['name']}")