X-Git-Url: https://harishankar.org/repos/?p=biaweb_qt.git;a=blobdiff_plain;f=generate_dialog.py;h=bd20db87840ae2ddcfd6273fbcb7d3def85bc8c8;hp=eb49933ea6cac02c9f79b9f52540f0d36d39f508;hb=cd074c8da38f6cc0ad808783ca7e631967dfdd47;hpb=61047f72eb7d61e1c0efd7f22729e16fbfb97505
diff --git a/generate_dialog.py b/generate_dialog.py
index eb49933..bd20db8 100644
--- a/generate_dialog.py
+++ b/generate_dialog.py
@@ -2,18 +2,113 @@
# Generate site dialog
import PyQt4
+import sys
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):
def __init__ (self, master, currentdb):
PyQt4.QtGui.QDialog.__init__ (self, master)
self.setupUi (self)
+ # update the status of required additional files to be copied to
+ # the destination directory and warn the user accordingly
+ self.set_required_files_status ()
+
# set the database
self.current_db = currentdb
+ # function to set the status message of the required additional files to be copied to
+ # the destination directory. If any required additional file is missing in the script
+ # path then warn the user to copy those files manually to the destination directory
+ def set_required_files_status (self):
+ search_script_path = os.path.join (sys.path[0], "search.py")
+ star_image_path = os.path.join (sys.path[0], "star.gif")
+ stargrey_image_path = os.path.join (sys.path[0], "star-grey.gif")
+
+ # if search.py exists in script directory
+ if os.path.exists (search_script_path):
+ self.status_search_py.setText ('will be \
+ automatically copied to destination dir')
+ else:
+ self.status_search_py.setText ('cannot be found.\
+ You must copy it manually to cgi-bin')
+
+ # if star.gif exists in script directory
+ if os.path.exists (star_image_path):
+ self.status_star_gif.setText ('will be \
+ automatically copied to destination dir')
+ else:
+ self.status_star_gif.setText ('Cannot be found. \
+ You must copy it manually to destination dirwill be \
+ automatically copied to destination dir')
+ else:
+ self.status_stargrey_gif.setText ('cannot be found. \
+ You must copy it manually to destination dir