import os
import os.path
import ui_generate_dialog
+import biaweb_db
import biaweb_exporter
class GenerateDialog (PyQt4.QtGui.QDialog, ui_generate_dialog.Ui_SiteGenerateDialog):
# when site generate button is clicked
def onSiteGenerate (self):
+ # first check whether there are any articles in the website. If no articles
+ # are found, then website cannot be generated
+ arts = biaweb_db.get_articles (self.current_db)
+ # if no articles are found or cannot be retrieved
+ if arts == False or len (arts) == 0:
+ PyQt4.QtGui.QMessageBox.critical (self, "Error", "Cannot create website with no articles")
+ return
+
files_list = self.get_list_from_tree (self.additional_files)
folder_list = self.get_list_from_tree (self.additional_folders)
if self.fulltextindex.isChecked ():