From: Zac Medico Date: Fri, 18 May 2007 22:17:33 +0000 (-0000) Subject: Only show extra whitespace where there are some news items to display. X-Git-Tag: v2.2_pre1~1414 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3f40153497a8a623f595290dd30859276ab1fb4c;p=portage.git Only show extra whitespace where there are some news items to display. svn path=/main/trunk/; revision=6551 --- 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.