diff options
Diffstat (limited to 'layman')
-rwxr-xr-x | layman/api.py | 8 | ||||
-rw-r--r-- | layman/config.py | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/layman/api.py b/layman/api.py index 4ff62dd..3f33a42 100755 --- a/layman/api.py +++ b/layman/api.py @@ -562,9 +562,17 @@ class LaymanAPI(object): settings, trees, mtimedb = load_emerge_config() display_news_notification( trees[settings["ROOT"]]["root_config"], {}) + elif self.config['news_reporter'] == 'custom': + if self.config['custom_news_func'] is None: + _temp = __import__( + 'custom_news_pkg', globals(), locals(), + ['layman_news_func'], -1) + self.config['custom_news_func'] = _temp.custom_news_func self.config['custom_news_func'](repos) + elif self.config['news_reporter'] == 'pkgcore': + # pkgcore is not yet capable return except Exception as err: msg = "update_news() failed running %s news reporter function\n" +\ diff --git a/layman/config.py b/layman/config.py index c245853..0541d92 100644 --- a/layman/config.py +++ b/layman/config.py @@ -96,6 +96,7 @@ class BareConfig(object): 'proxy' : '', 'umask' : '0022', 'news_reporter': 'portage', + 'custom_news_pkg': '', 'overlays' : 'http://www.gentoo.org/proj/en/overlays/repositories.xml', 'overlay_defs': '%(configdir)s/overlays', |