X-Git-Url: https://harishankar.org/repos/?p=biaweb_qt.git;a=blobdiff_plain;f=main_window.py;h=57762afd9a9f12c64c28b455986044a88cc15351;hp=896353602418e5950578e03125f6b2e9b6903ab4;hb=ba3069991aeda91317057aa2c115f8c2151d0a98;hpb=3ded989fee52f6804d0f8b5b5c0847a9030c7f04 diff --git a/main_window.py b/main_window.py index 8963536..57762af 100644 --- a/main_window.py +++ b/main_window.py @@ -23,7 +23,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): recs = biaweb_db.get_categories (self.current_db) # check with False because None is returned when no records exist - if recs == False: + if recs is False: PyQt4.QtGui.QMessageBox.critical (self, "Error", "SQLite 3 error in getting the categories") return False @@ -40,7 +40,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): recs = biaweb_db.get_articles (self.current_db, catid) # check with False because None is returned when no records exist - if recs == False: + if recs is False: PyQt4.QtGui.QMessageBox.critical (self, "Error", "SQLite 3 error in getting the articles") return False @@ -49,6 +49,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): qrow = PyQt4.QtGui.QTreeWidgetItem ([str(item[0]), str(item[1])]) self.articles.addTopLevelItem (qrow) # return true when successful + return True # when the view is refreshed def onViewRefresh (self): @@ -341,7 +342,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): loaded_arts = self.repopulate_articles () # if failed in loading either categories or articles (note: checking against # False and not None) - if loaded_cats == False or loaded_arts == False: + if loaded_cats is False or loaded_arts is False: self.current_db = None PyQt4.QtGui.QMessageBox.critical (self, "Error", "SQLite 3 error in loading site database. This appears to be an invalid BiaWeb database")