depgraph: display 'searching for similar names'
authorZac Medico <zmedico@gentoo.org>
Mon, 31 Jan 2011 23:44:55 +0000 (15:44 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 31 Jan 2011 23:44:55 +0000 (15:44 -0800)
It can take few seconds to search, so display a status message.

pym/_emerge/depgraph.py

index 39c6395acc368d711b581c93beb9030f8c69d2dd..64e9b19bd617b9e9fab5d0855b86006c9f7540bd 100644 (file)
@@ -2619,6 +2619,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())
@@ -2638,12 +2641,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