mirror of
https://github.com/ihabunek/toot
synced 2024-12-23 07:27:12 +01:00
Extract print_divider
This commit is contained in:
parent
bf5eb9e7f8
commit
a4cf678b15
@ -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']}")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user