Package portage :: Module news
[hide private]

Module news

source code

Classes [hide private]
  NewsManager
This object manages GLEP 42 style news items.
  NewsItem
This class encapsulates a GLEP 42 style news item.
  DisplayRestriction
A base restriction object representing a restriction of display.
  DisplayProfileRestriction
A profile restriction where a particular item shall only be displayed if the user is running a specific profile.
  DisplayKeywordRestriction
A keyword restriction where a particular item shall only be displayed if the user is running a specific keyword.
  DisplayInstalledRestriction
An Installation restriction where a particular item shall only be displayed if the user has that item installed.
Functions [hide private]
dict
count_unread_news(portdb, vardb, repos=None, update=True)
Returns a dictionary mapping repos to integer counts of unread news items.
source code
 
display_news_notifications(news_counts)
Display a notification for unread news items, using a dictionary mapping repos to integer counts, like that returned from count_unread_news().
source code
Variables [hide private]
  _formatRE = re.compile(r'News-Item-Format:\s*([^\s]*)\s*$')
  _installedRE = re.compile(r'Display-If-Installed:(.*)\n')
  _profileRE = re.compile(r'Display-If-Profile:(.*)\n')
  _keywordRE = re.compile(r'Display-If-Keyword:(.*)\n')
  __package__ = 'portage'

Imports: io, logging, _os, re, portage, OrderedDict, os, _encodings, _unicode_decode, _unicode_encode, NEWS_LIB_PATH, apply_secpass_permissions, ensure_dirs, grabfile, normalize_path, write_atomic, writemsg_level, portage_gid, isvalidatom, _, lockfile, unlockfile, colorize, InvalidLocation, OperationNotPermitted, PermissionDenied, ReadOnlyFileSystem


Function Details [hide private]

count_unread_news(portdb, vardb, repos=None, update=True)

source code 

Returns a dictionary mapping repos to integer counts of unread news items. By default, this will scan all repos and check for new items that have appeared since the last scan.

Parameters:
  • portdb (pordbapi) - a portage tree database
  • vardb (vardbapi) - an installed package database
  • repos (list or None) - names of repos to scan (None means to scan all available repos)
  • update (boolean) - check for new items (default is True)
Returns: dict
dictionary mapping repos to integer counts of unread news items