From 8ed554dca95660c92e92d6b3a85407ec383dc89f Mon Sep 17 00:00:00 2001 From: lxnay Date: Sun, 15 Feb 2009 00:00:19 +0000 Subject: [PATCH] Entropy/Equo/text_query: - searchPackages: handle DatabaseError exceptions git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@3022 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- client/text_query.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/client/text_query.py b/client/text_query.py index b8657d5a6..a1785b245 100644 --- a/client/text_query.py +++ b/client/text_query.py @@ -764,23 +764,27 @@ def searchPackage(packages, idreturn = False, EquoConnection = None): tag = Equo.entropyTools.dep_gettag(package) package = Equo.entropyTools.remove_slot(package) package = Equo.entropyTools.remove_tag(package) - result = dbconn.searchPackages(package, slot = slot, tag = tag) - if (not result): # look for provide - result = dbconn.searchProvide(package, slot = slot, tag = tag) + try: - if (result): - foundPackages[repo][package] = result - # print info - for pkg in foundPackages[repo][package]: - idpackage = pkg[1] - if (idreturn): - dataInfo.add((idpackage,repo)) - else: - printPackageInfo(idpackage,dbconn, EquoConnection = Equo) - if (not idreturn) and (not etpUi['quiet']): - print_info(blue(" %s: " % (_("Keyword"),) )+bold("\t"+package)) - print_info(blue(" %s: " % (_("Found"),) )+bold("\t"+str(len(foundPackages[repo][package])))+red(" %s" % (_("entries"),) )) + result = dbconn.searchPackages(package, slot = slot, tag = tag) + if not result: # look for provide + result = dbconn.searchProvide(package, slot = slot, tag = tag) + if result: + foundPackages[repo][package] = result + # print info + for pkg in foundPackages[repo][package]: + idpackage = pkg[1] + if (idreturn): + dataInfo.add((idpackage,repo)) + else: + printPackageInfo(idpackage,dbconn, EquoConnection = Equo) + if not idreturn and not etpUi['quiet']: + print_info(blue(" %s: " % (_("Keyword"),) )+bold("\t"+package)) + print_info(blue(" %s: " % (_("Found"),) )+bold("\t"+str(len(foundPackages[repo][package])))+red(" %s" % (_("entries"),) )) + + except Equo.dbapi2.DatabaseError: + continue if (idreturn):