diff options
author | Sam Ockman | 2012-07-05 18:05:16 -0400 |
---|---|---|
committer | Sam Ockman | 2012-07-05 18:05:16 -0400 |
commit | d00a1b6ec9c71b8b8a771155716022030183ebcf (patch) | |
tree | 1850b69c82cbc5bcb0ef9e594d6ddc9b06bb9a4c | |
parent | d4085c3f85e392427067d2c004a0b15449fbc0d9 (diff) | |
download | genenetwork2-d00a1b6ec9c71b8b8a771155716022030183ebcf.tar.gz |
before cleaning up SharingInfo
-rwxr-xr-x | wqflask/wqflask/dataSharing/SharingInfo.py | 9 | ||||
-rwxr-xr-x | wqflask/wqflask/dataSharing/SharingInfoPage.py | 7 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 6 |
3 files changed, 15 insertions, 7 deletions
diff --git a/wqflask/wqflask/dataSharing/SharingInfo.py b/wqflask/wqflask/dataSharing/SharingInfo.py index 131a4551..018121c8 100755 --- a/wqflask/wqflask/dataSharing/SharingInfo.py +++ b/wqflask/wqflask/dataSharing/SharingInfo.py @@ -24,6 +24,10 @@ # # Last updated by GeneNetwork Core Team 2010/10/20 +from __future__ import print_function, division + +from pprint import pformat as pf + import httplib from dbFunction import webqtlDatabaseFunction @@ -33,9 +37,10 @@ import SharingBody ######################################### # Sharing Info ######################################### -class SharingInfo: +class SharingInfo(object): def __init__(self, GN_AccessionId, InfoPageName): + print("In SharingInfo") self.GN_AccessionId = GN_AccessionId self.InfoPageName = InfoPageName @@ -95,4 +100,6 @@ class SharingInfo: htmlfilelist += "</ul>" else: htmlfilelist = "Data sets are not available or are not public yet." + print("333 info is:", pf(info)) + print("333 keys:", pf(info)) return SharingBody.sharinginfo_body_string % (info[31], info[32], infoupdate, info[32], info[1], info[3], info[30], info[4], info[27], info[33], info[2], info[23], info[26], info[11], info[15], info[16], info[18], info[19], info[20], info[21], info[22], info[13], info[12], info[14], info[14], htmlfilelist, info[6], info[35], info[36], info[37], info[38], info[39], info[40], info[5], info[7], info[8], info[9], info[10], info[17], info[24]) diff --git a/wqflask/wqflask/dataSharing/SharingInfoPage.py b/wqflask/wqflask/dataSharing/SharingInfoPage.py index 91538a07..5503ff74 100755 --- a/wqflask/wqflask/dataSharing/SharingInfoPage.py +++ b/wqflask/wqflask/dataSharing/SharingInfoPage.py @@ -48,18 +48,17 @@ class SharingInfoPage(templatePage): print("fd is:", pf(fd.__dict__)) # Todo: Need a [0] in line below????d GN_AccessionId = fd.get('GN_AccessionId') # Used under search datasharing - InfoPageName = fd['database'][0] + InfoPageName = fd.get('database') # Might need to add a [0] cursor = webqtlDatabaseFunction.getCursor() if InfoPageName and not GN_AccessionId: sql = "select GN_AccesionId from InfoFiles where InfoPageName = %s" cursor.execute(sql, InfoPageName) GN_AccessionId = cursor.fetchone() - self.redirect_url = "http://23.21.59.238:5001/data_sharing&GN_AccessionId=%s" % GN_AccessionId + self.redirect_url = "http://23.21.59.238:5001/data_sharing?GN_AccessionId=%s" % GN_AccessionId #self.redirect_url = flask.url_for('data_sharing', GN_AccessionId=GN_AccessionId[0]) print("set self.redirect_url") #print("before redirect") #return flask.redirect(url) #print("after redirect") else: - sharingInfoObject = SharingInfo.SharingInfo(GN_AccessionId, InfoPageName) - self.dict['body'] = sharingInfoObject.getBody(infoupdate="") + CauseError diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index caad811f..67351784 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -9,7 +9,7 @@ from flask import render_template, request from wqflask import search_results from wqflask.show_trait import show_trait_page -from wqflask.dataSharing import SharingInfoPage +from wqflask.dataSharing import SharingInfo, SharingInfoPage from base import webqtlFormData @@ -27,7 +27,9 @@ def data_sharing(): print("In data_sharing") fd = webqtlFormData.webqtlFormData(request.args) print("1Have fd") - template_vars = SharingInfoPage.SharingInfoPage(fd) + sharingInfoObject = SharingInfo.SharingInfo(request.args['GN_AccessionId'], None) + self.dict['body'] = sharingInfoObject.getBody(infoupdate="") + template_vars = SharingInfo.SharingInfo(request.args['GN_AccessionId'], None) print("1 Made it to rendering") return template_vars |