diff options
author | Marius Mauch <genone@gentoo.org> | 2007-04-30 02:31:30 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2007-04-30 02:31:30 +0000 |
commit | 644a6284be66bc1648a930e7c19749741df09a5e (patch) | |
tree | b18404d6f495deb758ec3a8cd8224742a9f78344 /pym/portage/elog/mod_echo.py | |
parent | f281ed3e6888b50fdaaf615a0e6065b391fb9409 (diff) | |
download | portage-644a6284be66bc1648a930e7c19749741df09a5e.tar.gz portage-644a6284be66bc1648a930e7c19749741df09a5e.tar.bz2 portage-644a6284be66bc1648a930e7c19749741df09a5e.zip |
- add new echo module for people who don't want any real logging
- add copyright header in elog modules and enable keyword substitution
- enable save_summary and echo modules in make.globals
svn path=/main/trunk/; revision=6458
Diffstat (limited to 'pym/portage/elog/mod_echo.py')
-rw-r--r-- | pym/portage/elog/mod_echo.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pym/portage/elog/mod_echo.py b/pym/portage/elog/mod_echo.py new file mode 100644 index 000000000..73928b437 --- /dev/null +++ b/pym/portage/elog/mod_echo.py @@ -0,0 +1,30 @@ +# elog/mod_echo.py - elog dispatch module +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +from portage.output import EOutput +from portage.const import EBUILD_PHASES + +_items = {} +def process(mysettings, cpv, logentries, fulltext): + _items[cpv] = logentries + +def finalize(mysettings): + printer = EOutput() + for cpv in _items.keys(): + print + printer.einfo("Messages for package %s:" % cpv) + print + for phase in EBUILD_PHASES: + if not phase in _items[cpv]: + continue + for msgtype, msgcontent in _items[cpv][phase]: + fmap = {"INFO": printer.einfo, + "WARN": printer.ewarn, + "ERROR": printer.eerror, + "LOG": printer.einfo, + "QA": printer.ewarn} + for line in msgcontent: + fmap[msgtype](line.strip("\n")) + return |