From 0dacaf0ad0d05c6c6f5c97d044cade22f6a04a3e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 31 Jan 2011 15:44:55 -0800 Subject: [PATCH] depgraph: display 'searching for similar names' It can take few seconds to search, so display a status message. --- pym/_emerge/depgraph.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 0c56e35ef..99d481031 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2623,6 +2623,9 @@ class depgraph(object): if cat == "null": cat = None + writemsg_stdout("\nemerge: searching for similar names..." + , noiselevel=-1) + all_cp = set() all_cp.update(vardb.cp_all()) all_cp.update(portdb.cp_all()) @@ -2642,12 +2645,17 @@ class depgraph(object): matches.extend(pkg_to_cp[pkg_match]) if len(matches) == 1: - writemsg_stdout("emerge: Maybe you meant " + matches[0] + "?\n" + writemsg_stdout("\nemerge: Maybe you meant " + matches[0] + "?\n" , noiselevel=-1) elif len(matches) > 1: - writemsg_stdout("emerge: Maybe you meant any of these: " + ", ".join(matches) + "?\n" + writemsg_stdout( + "\nemerge: Maybe you meant any of these: %s?\n" % \ + (", ".join(matches),), noiselevel=-1) + else: + # Generally, this would only happen if + # all dbapis are empty. + writemsg_stdout(" nothing similar found.\n" , noiselevel=-1) - msg = [] if not isinstance(myparent, AtomArg): # It's redundant to show parent for AtomArg since -- 2.26.2