def _inbox(config, client):
"""Show a list of notifications on a click pager.
Args:
config (Config): config object used for getting .two1 information
client (two1.server.rest_client.TwentyOneRestClient) an object for
sending authenticated requests to the TwentyOne backend.
Returns:
list: list of notifications in users inbox
"""
prints = []
notifications, has_unreads = get_notifications(config, client)
if not notifications:
logger.info("Inbox empty")
return notifications
if len(notifications) > 0:
prints.append(uxstring.UxString.notification_intro)
prints.extend(notifications)
output = "\n".join(prints)
logger.info(output, pager=True)
if has_unreads:
client.mark_notifications_read(config.username)
return tuple(map(click.unstyle, notifications))
评论列表
文章目录