import portage
from portage import os
from portage import _encodings
+from portage import _unicode_decode
from portage.output import xtermTitle
from _emerge.getloadavg import getloadavg
f = formatter.AbstractFormatter(style_writer)
number_style = "INFORM"
- f.add_literal_data("Jobs: ")
+ f.add_literal_data(_unicode_decode("Jobs: "))
f.push_style(number_style)
- f.add_literal_data(curval_str)
+ f.add_literal_data(_unicode_decode(curval_str))
f.pop_style()
- f.add_literal_data(" of ")
+ f.add_literal_data(_unicode_decode(" of "))
f.push_style(number_style)
- f.add_literal_data(maxval_str)
+ f.add_literal_data(_unicode_decode(maxval_str))
f.pop_style()
- f.add_literal_data(" complete")
+ f.add_literal_data(_unicode_decode(" complete"))
if self.running:
- f.add_literal_data(", ")
+ f.add_literal_data(_unicode_decode(", "))
f.push_style(number_style)
- f.add_literal_data(running_str)
+ f.add_literal_data(_unicode_decode(running_str))
f.pop_style()
- f.add_literal_data(" running")
+ f.add_literal_data(_unicode_decode(" running"))
if self.failed:
- f.add_literal_data(", ")
+ f.add_literal_data(_unicode_decode(", "))
f.push_style(number_style)
- f.add_literal_data(failed_str)
+ f.add_literal_data(_unicode_decode(failed_str))
f.pop_style()
- f.add_literal_data(" failed")
+ f.add_literal_data(_unicode_decode(" failed"))
padding = self._jobs_column_width - len(plain_output.getvalue())
if padding > 0:
- f.add_literal_data(padding * " ")
+ f.add_literal_data(padding * _unicode_decode(" "))
- f.add_literal_data("Load avg: ")
- f.add_literal_data(load_avg_str)
+ f.add_literal_data(_unicode_decode("Load avg: "))
+ f.add_literal_data(_unicode_decode(load_avg_str))
# Truncate to fit width, to avoid making the terminal scroll if the
# line overflows (happens when the load average is large).
from portage import os
from portage import _encodings
from portage import _unicode_encode
+from portage import _unicode_decode
from portage.const import COLOR_MAP_FILE
from portage.exception import CommandNotFound, FileNotFound, \
ParseError, PermissionDenied, PortageException
codes = object.__getattribute__(codes, '_attr')
_styles = object.__getattribute__(_styles, '_attr')
+ for k, v in codes.iteritems():
+ codes[k] = _unicode_decode(v)
+
+ for k, v in _styles.iteritems():
+ _styles[k] = _unicode_decode(v)
+
try:
_parse_color_map(config_root=config_root,
onerror=lambda e: writemsg("%s\n" % str(e), noiselevel=-1))