diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-08 22:24:27 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-08 22:24:27 +0000 |
commit | 96c773f83c9fbcd4b09805e0604491ce3bfd33c4 (patch) | |
tree | d41cab54efce147c5b9e943223a69bd286fc5fdb | |
parent | d1039bed335766b46f20b38e00c6c2d52b3786e0 (diff) | |
download | portage-96c773f83c9fbcd4b09805e0604491ce3bfd33c4.tar.gz portage-96c773f83c9fbcd4b09805e0604491ce3bfd33c4.tar.bz2 portage-96c773f83c9fbcd4b09805e0604491ce3bfd33c4.zip |
Use writemsg_stdout() for safe unicode output.
svn path=/main/trunk/; revision=13955
-rw-r--r-- | pym/_emerge/search.py | 26 |
1 files changed, 18 insertions, 8 deletions
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 # |