From: Zac Medico Date: Sat, 8 Aug 2009 22:24:27 +0000 (-0000) Subject: Use writemsg_stdout() for safe unicode output. X-Git-Tag: v2.2_rc37~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=96c773f83c9fbcd4b09805e0604491ce3bfd33c4;p=portage.git Use writemsg_stdout() for safe unicode output. svn path=/main/trunk/; revision=13955 --- diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py index 96b3398b0..afbd1d557 100644 --- a/pym/_emerge/search.py +++ b/pym/_emerge/search.py @@ -14,7 +14,8 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage -from portage.output import bold as white, darkgreen, green, red +from portage.output import bold, bold as white, darkgreen, green, red +from portage.util import writemsg_stdout from _emerge.Package import Package from _emerge.visible import visible @@ -288,9 +289,14 @@ class search(object): full_package = match match = portage.cpv_getkey(match) elif mtype == "set": - print green("*")+" "+white(match) - print " ", darkgreen("Description:")+" ", self.sdict[match].getMetadata("DESCRIPTION") - print + msg = [] + msg.append(green("*") + " " + bold(match) + "\n") + if self.verbose: + msg.append(" " + darkgreen("Description:") + \ + " " + \ + self.sdict[match].getMetadata("DESCRIPTION") \ + + "\n\n") + writemsg_stdout(''.join(msg), noiselevel=-1) if full_package: try: desc, homepage, license = self.portdb.aux_get( @@ -350,16 +356,20 @@ class search(object): file_size_str = mystr + " kB" if self.verbose: + msg = [] if available: print " ", darkgreen("Latest version available:"),myversion print " ", self.getInstallationStatus(mycat+'/'+mypkg) if myebuild: print " %s %s" % \ (darkgreen("Size of files:"), file_size_str) - print " ", darkgreen("Homepage:")+" ",homepage - print " ", darkgreen("Description:")+" ",desc - print " ", darkgreen("License:")+" ",license - print + msg.append(" " + darkgreen("Homepage:") + \ + " " + homepage + "\n") + msg.append(" " + darkgreen("Description:") \ + + " " + desc + "\n") + msg.append(" " + darkgreen("License:") + \ + " " + license + "\n\n") + writemsg_stdout(''.join(msg), noiselevel=-1) # # private interface #