Add error messaging for missing search parameters

bzr-revno: 295
This commit is contained in:
Tim Bentley 2009-02-03 19:13:33 +00:00
parent fdf66b3bd5
commit ffeada555d
2 changed files with 11 additions and 9 deletions

View File

@ -381,6 +381,7 @@ class BiblePlugin(Plugin, PluginUtils):
sverse=""
everse=""
search.replace(" ", " ")
message = None
#search = search.replace("v", ":") # allow V or v for verse instead of :
#search = search.replace("V", ":") # allow V or v for verse instead of :
co = search.find(":")
@ -423,16 +424,18 @@ class BiblePlugin(Plugin, PluginUtils):
sverse = 1
if everse == "":
everse = 99
print "book = " + book
print "chapter s =" + str(schapter)
print "chapter e =" + str(echapter)
print "verse s =" + str(sverse)
print "verse e =" + str(everse)
if not schapter == "":
if schapter == "":
message = "No chapter found for search"
# print "book = " + book
# print "chapter s =" + str(schapter)
# print "chapter e =" + str(echapter)
# print "verse s =" + str(sverse)
# print "verse e =" + str(everse)
if message == None:
self.searchresults = self.biblemanager.get_verse_text(bible, book,int(schapter), int(echapter), int(sverse), int(everse))
self._display_results(bible)
else:
QMessageBox.information(self,"Information","A plain, informational message")
reply = QtGui.QMessageBox.information(self.MediaManagerItem,"Information",message)

View File

@ -39,7 +39,6 @@ class BibleDBImpl(BibleCommon):
self.biblefile = os.path.join(biblepath, biblename+u'.sqlite')
log.debug( "Load bible %s on path %s", biblename, self.biblefile)
db_type = self.config.get_config(u'db type')
db_type = u'sqlite'
if db_type == u'sqlite':
self.db = create_engine("sqlite:///"+self.biblefile)
else: