aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/templatePage.py
diff options
context:
space:
mode:
authorZachary Sloan2012-10-26 17:02:42 -0500
committerZachary Sloan2012-10-26 17:02:42 -0500
commit5083b031f0041f6df3c99180bd06243625af728e (patch)
tree4803154fcb7858f1a78103fc93f043ca790795a8 /wqflask/base/templatePage.py
parent82bcb31455d658a462bfde711c862480fc9acd05 (diff)
downloadgenenetwork2-5083b031f0041f6df3c99180bd06243625af728e.tar.gz
Got search page working for mice with a single gene search
Diffstat (limited to 'wqflask/base/templatePage.py')
-rwxr-xr-xwqflask/base/templatePage.py20
1 files changed, 10 insertions, 10 deletions
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'