diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-11-12 23:17:58 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-11-12 23:17:58 +0000 |
commit | d01a91cbd8033b4dda59e404d005a8ea62eb4692 (patch) | |
tree | ad4f6701c9a74bd04ce10561c27b12a57c9ec03f | |
parent | 366f0030e491917568a4df059e4af4c53a814301 (diff) | |
download | portage-d01a91cbd8033b4dda59e404d005a8ea62eb4692.tar.gz portage-d01a91cbd8033b4dda59e404d005a8ea62eb4692.tar.bz2 portage-d01a91cbd8033b4dda59e404d005a8ea62eb4692.zip |
Bug #292910 - Don't mix print() and writemsg_stdout(), in order to avoid
buffering issues.
svn path=/main/trunk/; revision=14818
-rw-r--r-- | pym/_emerge/search.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py index f0611f28a..e5ad91da2 100644 --- a/pym/_emerge/search.py +++ b/pym/_emerge/search.py @@ -262,9 +262,11 @@ class search(object): def output(self): """Outputs the results of the search.""" - print("\b\b \n[ Results for search key : "+white(self.searchkey)+" ]") - print("[ Applications found : "+white(str(self.mlen))+" ]") - print(" ") + msg = [] + msg.append("\b\b \n[ Results for search key : " + \ + bold(self.searchkey) + " ]\n") + msg.append("[ Applications found : " + \ + bold(str(self.mlen)) + " ]\n\n") vardb = self.vartree.dbapi for mtype in self.matches: for match,masked in self.matches[mtype]: @@ -282,7 +284,6 @@ class search(object): full_package = match match = portage.cpv_getkey(match) elif mtype == "set": - msg = [] msg.append(green("*") + " " + bold(match) + "\n") if self.verbose: msg.append(" " + darkgreen("Description:") + \ @@ -295,12 +296,13 @@ class search(object): desc, homepage, license = self.portdb.aux_get( full_package, ["DESCRIPTION","HOMEPAGE","LICENSE"]) except KeyError: - print("emerge: search: aux_get() failed, skipping") + msg.append("emerge: search: aux_get() failed, skipping\n") continue if masked: - print(green("*")+" "+white(match)+" "+red("[ Masked ]")) + msg.append(green("*") + " " + \ + white(match) + " " + red("[ Masked ]") + "\n") else: - print(green("*")+" "+white(match)) + msg.append(green("*") + " " + bold(match) + "\n") myversion = self.getVersion(full_package, search.VERSION_RELEASE) mysum = [0,0] @@ -349,12 +351,14 @@ 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)) + msg.append(" %s %s\n" % \ + (darkgreen("Latest version available:"), + myversion)) + msg.append(" %s\n" % \ + self.getInstallationStatus(mycat+'/'+mypkg)) if myebuild: - print(" %s %s" % \ + msg.append(" %s %s\n" % \ (darkgreen("Size of files:"), file_size_str)) msg.append(" " + darkgreen("Homepage:") + \ " " + homepage + "\n") @@ -362,7 +366,7 @@ class search(object): + " " + desc + "\n") msg.append(" " + darkgreen("License:") + \ " " + license + "\n\n") - writemsg_stdout(''.join(msg), noiselevel=-1) + writemsg_stdout(''.join(msg), noiselevel=-1) # # private interface # |