from xml.parsers.expat import ExpatError
from portage import os
from portage import _encodings
+from portage import _unicode_decode
from portage import _unicode_encode
from portage import output
from portage.output import red, green
# we only want key value pairs where value > 0
for category, number in \
itertools.ifilter(lambda myitem: myitem[1] > 0, stats.iteritems()):
- formatter.add_literal_data(" " + category.ljust(30))
+ formatter.add_literal_data(_unicode_decode(" " + category.ljust(30)))
if category in qawarnings:
formatter.push_style("WARN")
else:
formatter.push_style("BAD")
- formatter.add_literal_data(str(number))
+ formatter.add_literal_data(_unicode_decode(str(number)))
formatter.pop_style()
formatter.add_line_break()
if not dofull:
if not full and len(fails_list) > 12:
fails_list = fails_list[:12]
for failure in fails_list:
- formatter.add_literal_data(" " + failure)
+ formatter.add_literal_data(_unicode_decode(" " + failure))
formatter.add_line_break()
from tempfile import mkstemp
fd, filename = mkstemp()
try:
- os.write(fd, "\n# Please enter the commit message " + \
+ os.write(fd, _unicode_encode(
+ "\n# Please enter the commit message " + \
"for your changes.\n# (Comment lines starting " + \
- "with '#' will not be included)\n")
+ "with '#' will not be included)\n",
+ encoding=_encodings['content'], errors='backslashreplace'))
if message:
- os.write(fd, "#\n")
+ os.write(fd, _unicode_encode("#\n",
+ encoding=_encodings['content'], errors='backslashreplace'))
for line in message:
- os.write(fd, "#" + line)
+ os.write(fd, _unicode_encode("#" + line,
+ encoding=_encodings['content'], errors='backslashreplace'))
os.close(fd)
retval = os.system(editor + " '%s'" % filename)
if not (os.WIFEXITED(retval) and os.WEXITSTATUS(retval) == os.EX_OK):