aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2020-03-03 15:37:19 -0600
committerzsloan2020-03-03 15:37:19 -0600
commitcf49e1ea02568fa9b31505c08e68baf844703c15 (patch)
tree932c7908ef2f7ed5bca55b64c4ec829cade1d13f
parenteda3b9d1ed752ef644914ebcff32f861ebb1d096 (diff)
downloadgenenetwork2-cf49e1ea02568fa9b31505c08e68baf844703c15.tar.gz
Forgot to replace code referring to hmac function user_manager
-rw-r--r--wqflask/base/trait.py11
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py5
-rw-r--r--wqflask/wqflask/correlation_matrix/show_corr_matrix.py1
-rw-r--r--wqflask/wqflask/gsearch.py6
-rw-r--r--wqflask/wqflask/search_results.py5
5 files changed, 12 insertions, 16 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 7ec764d8..c9dfe780 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -13,6 +13,7 @@ from base.webqtlCaseData import webqtlCaseData
from base.data_set import create_dataset
from db import webqtlDatabaseFunction
from utility import webqtlUtil
+from utility import hmac
from wqflask import app
@@ -25,8 +26,6 @@ from flask import Flask, g, request, url_for
from utility.logger import getLogger
logger = getLogger(__name__ )
-from wqflask import user_manager
-
class GeneralTrait(object):
"""
Trait class defines a trait in webqtl, can be either Microarray,
@@ -304,7 +303,7 @@ def jsonable_table_row(trait, dataset_name, index):
additive = "N/A"
else:
additive = "%.3f" % round(float(trait.additive), 2)
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.hmac_creation('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.symbol,
@@ -320,7 +319,7 @@ def jsonable_table_row(trait, dataset_name, index):
else:
additive = "%.2f" % round(float(trait.additive), 2)
if trait.pubmed_id:
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.hmac_creation('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.description_display,
@@ -330,7 +329,7 @@ def jsonable_table_row(trait, dataset_name, index):
trait.LRS_location_repr,
additive]
else:
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.hmac_creation('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.description_display,
@@ -340,7 +339,7 @@ def jsonable_table_row(trait, dataset_name, index):
trait.LRS_location_repr,
additive]
elif dataset.type == "Geno":
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.hmac_creation('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.location_repr]
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 0654e5d3..cc74c8e4 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -49,14 +49,13 @@ from utility.THCell import THCell
from utility.TDCell import TDCell
from base.trait import GeneralTrait
from base import data_set
-from utility import webqtlUtil, helper_functions, corr_result_helpers
+from utility import webqtlUtil, helper_functions, corr_result_helpers, hmac
from db import webqtlDatabaseFunction
import utility.webqtlUtil #this is for parallel computing only.
from wqflask.correlation import correlation_functions
from utility.benchmark import Bench
import utility.webqtlUtil
from utility.type_checking import is_float, is_int, is_str, get_float, get_int, get_string
-from wqflask import user_manager
from MySQLdb import escape_string as escape
@@ -499,7 +498,7 @@ def generate_corr_json(corr_results, this_trait, dataset, target_dataset, for_ap
for i, trait in enumerate(corr_results):
results_dict = {}
if not for_api:
- results_dict['checkbox'] = "<INPUT TYPE='checkbox' NAME='searchResult' class='checkbox trait_checkbox' style='padding-right: 0px;' VALUE='" + user_manager.data_hmac('{}:{}'.format(trait.name, trait.dataset.name)) + "'>"
+ results_dict['checkbox'] = "<INPUT TYPE='checkbox' NAME='searchResult' class='checkbox trait_checkbox' style='padding-right: 0px;' VALUE='" + hmac.hmac_creation('{}:{}'.format(trait.name, trait.dataset.name)) + "'>"
results_dict['index'] = i + 1
results_dict['trait_id'] = "<a href='/show_trait?trait_id="+str(trait.name)+"&dataset="+str(dataset.name)+"'>"+str(trait.name)+"</a>"
else:
diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
index 9c31bcfe..b5c45d05 100644
--- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
+++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
@@ -46,7 +46,6 @@ import reaper
import redis
Redis = redis.StrictRedis()
-from wqflask.user_manager import data_hmac
from utility.THCell import THCell
from utility.TDCell import TDCell
from base.trait import GeneralTrait
diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py
index b3a45f45..ed3b74b8 100644
--- a/wqflask/wqflask/gsearch.py
+++ b/wqflask/wqflask/gsearch.py
@@ -9,7 +9,7 @@ from db import webqtlDatabaseFunction
from base import webqtlConfig
-from wqflask import user_manager
+from utility import hmac
from utility.type_checking import is_float, is_int, is_str, get_float, get_int, get_string
from utility.benchmark import Bench
@@ -70,7 +70,7 @@ class GSearch(object):
this_trait['name'] = line[5]
this_trait['dataset'] = line[3]
this_trait['dataset_fullname'] = line[4]
- this_trait['hmac'] = user_manager.data_hmac('{}:{}'.format(line[5], line[3]))
+ this_trait['hmac'] = hmac.hmac_creation('{}:{}'.format(line[5], line[3]))
this_trait['species'] = line[0]
this_trait['group'] = line[1]
this_trait['tissue'] = line[2]
@@ -174,7 +174,7 @@ class GSearch(object):
this_trait['display_name'] = this_trait['name']
this_trait['dataset'] = line[2]
this_trait['dataset_fullname'] = line[3]
- this_trait['hmac'] = user_manager.data_hmac('{}:{}'.format(line[4], line[2]))
+ this_trait['hmac'] = hmac.hmac_creation('{}:{}'.format(line[4], line[2]))
this_trait['species'] = line[0]
this_trait['group'] = line[1]
if line[9] != None and line[6] != None:
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index d76add67..902317a4 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -24,11 +24,10 @@ from wqflask import do_search
from utility import webqtlUtil,tools
from db import webqtlDatabaseFunction
-from wqflask import user_manager
-
from flask import render_template, Flask, g
from utility import formatting
+from utility import hmac
from utility.type_checking import is_float, is_int, is_str, get_float, get_int, get_string
from utility.logger import getLogger
@@ -121,7 +120,7 @@ views.py).
else:
trait_dict['display_name'] = this_trait.name
trait_dict['dataset'] = this_trait.dataset.name
- trait_dict['hmac'] = user_manager.data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name))
+ trait_dict['hmac'] = hmac.hmac_creation('{}:{}'.format(this_trait.name, this_trait.dataset.name))
if this_trait.dataset.type == "ProbeSet":
trait_dict['symbol'] = this_trait.symbol
trait_dict['description'] = this_trait.description_display.decode('utf-8', 'replace')