From 5083b031f0041f6df3c99180bd06243625af728e Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Fri, 26 Oct 2012 17:02:42 -0500 Subject: Got search page working for mice with a single gene search --- wqflask/base/templatePage.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'wqflask/base/templatePage.py') diff --git a/wqflask/base/templatePage.py b/wqflask/base/templatePage.py index 7ef58a72..a94d5153 100755 --- a/wqflask/base/templatePage.py +++ b/wqflask/base/templatePage.py @@ -155,29 +155,29 @@ class templatePage: def openMysql(self): try: - self.con = MySQLdb.Connect(db=webqtlConfig.DB_NAME,host=webqtlConfig.MYSQL_SERVER, \ + self.db_conn = MySQLdb.Connect(db=webqtlConfig.DB_NAME,host=webqtlConfig.MYSQL_SERVER, \ user=webqtlConfig.DB_USER,passwd=webqtlConfig.DB_PASSWD) - self.cursor = self.con.cursor() - return 1 - except: + self.cursor = self.db_conn.cursor() + return True + except Exception: heading = "Connect MySQL Server" detail = ["Can't connect to MySQL server on '"+ webqtlConfig.MYSQL_SERVER+"':100061. \ The server may be down at this time"] self.error(heading=heading,detail=detail,error="Error 2003") - return 0 + return False def updMysql(self): try: - self.con = MySQLdb.Connect(db=webqtlConfig.DB_UPDNAME,host=webqtlConfig.MYSQL_UPDSERVER, \ + self.db_conn = MySQLdb.Connect(db=webqtlConfig.DB_UPDNAME,host=webqtlConfig.MYSQL_UPDSERVER, \ user=webqtlConfig.DB_UPDUSER,passwd=webqtlConfig.DB_UPDPASSWD) - self.cursor = self.con.cursor() - return 1 - except: + self.cursor = self.db_conn.cursor() + return True + except Exception: heading = "Connect MySQL Server" detail = ["update: Can't connect to MySQL server on '"+ webqtlConfig.MYSQL_UPDSERVER+"':100061. \ The server may be down at this time "] self.error(heading=heading,detail=detail,error="Error 2003") - return 0 + return False def error(self,heading="",intro=[],detail=[],title="Error",error="Error"): 'generating a WebQTL style error page' -- cgit v1.2.3