From 3f40153497a8a623f595290dd30859276ab1fb4c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 18 May 2007 22:17:33 +0000 Subject: [PATCH] Only show extra whitespace where there are some news items to display. svn path=/main/trunk/; revision=6551 --- pym/emerge/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 6e091ab51..9fead5459 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -3730,20 +3730,22 @@ def display_news_notification(settings): UNREAD_PATH = os.path.join(target_root, NEWS_LIB_PATH, "news") porttree = portdbapi(porttree_root=settings["PORTDIR"], mysettings=settings) newsReaderDisplay = False - - print + for repo in porttree.getRepositories(): unreadItems = checkUpdatedNewsItems(target_root, NEWS_PATH, UNREAD_PATH, repo) if unreadItems: + if not newsReaderDisplay: + newsReaderDisplay = True + print print colorize("WARN", " * IMPORTANT:"), print "%s news items need reading for repository '%s'." % (unreadItems, repo) - newsReaderDisplay = True + if newsReaderDisplay: print colorize("WARN", " *"), print "Use " + colorize("GOOD", "eselect news") + " to read news items." + print - print def post_emerge(settings, mtimedb, retval): """ Misc. things to run at the end of a merge session. -- 2.26.2