# elog/__init__.py - elog core functions
-# Copyright 2006-2009 Gentoo Foundation
+# Copyright 2006-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+import sys
+if sys.hexversion >= 0x3000000:
+ basestring = str
+
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.util:writemsg',
if previous_type != msgtype:
previous_type = msgtype
rValue.append("%s: %s" % (msgtype, phase))
- for line in msgcontent:
- rValue.append(line.rstrip("\n"))
- rValue.append("")
+ if isinstance(msgcontent, basestring):
+ rValue.append(msgcontent.rstrip("\n"))
+ else:
+ for line in msgcontent:
+ rValue.append(line.rstrip("\n"))
+ if rValue:
+ rValue.append("")
return "\n".join(rValue)
_elog_mod_imports = {}