aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/helper_functions.py16
-rw-r--r--wqflask/utility/tools.py8
2 files changed, 16 insertions, 8 deletions
diff --git a/wqflask/utility/helper_functions.py b/wqflask/utility/helper_functions.py
index 15f60765..149ee553 100644
--- a/wqflask/utility/helper_functions.py
+++ b/wqflask/utility/helper_functions.py
@@ -4,6 +4,8 @@ from base.trait import GeneralTrait
from base import data_set
from base.species import TheSpecies
+from wqflask import user_manager
+
def get_species_dataset_trait(self, start_vars):
#assert type(read_genotype) == type(bool()), "Expecting boolean value for read_genotype"
@@ -23,13 +25,15 @@ def get_species_dataset_trait(self, start_vars):
def get_trait_db_obs(self, trait_db_list):
-
+ if isinstance(trait_db_list, basestring):
+ trait_db_list = trait_db_list.split(",")
+
self.trait_list = []
- for i, trait_db in enumerate(trait_db_list):
- if i == (len(trait_db_list) - 1):
- break
- trait_name, dataset_name = trait_db.split(":")
- #print("dataset_name:", dataset_name)
+ for trait in trait_db_list:
+ data, _separator, hmac = trait.rpartition(':')
+ data = data.strip()
+ assert hmac==user_manager.actual_hmac_creation(data), "Data tampering?"
+ trait_name, dataset_name = data.split(":")
dataset_ob = data_set.create_dataset(dataset_name)
trait_ob = GeneralTrait(dataset=dataset_ob,
name=trait_name,
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index bb8241f5..907b0d6a 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -3,6 +3,7 @@
import os
import sys
+
from wqflask import app
# Use the standard logger here to avoid a circular dependency
@@ -146,7 +147,10 @@ def locate_ignore_error(name, subdir=None):
return None
def tempdir():
- return valid_path(get_setting("TEMPDIR","/tmp"))
+ """
+ Get UNIX TMPDIR by default
+ """
+ return valid_path(get_setting("TMPDIR","/tmp"))
BLUE = '\033[94m'
GREEN = '\033[92m'
@@ -183,9 +187,9 @@ LOG_BENCH = get_setting_bool('LOG_BENCH')
LOG_FORMAT = "%(message)s" # not yet in use
USE_REDIS = get_setting_bool('USE_REDIS')
USE_GN_SERVER = get_setting_bool('USE_GN_SERVER')
+GENENETWORK_FILES = get_setting_bool('GENENETWORK_FILES')
PYLMM_COMMAND = pylmm_command()
GEMMA_COMMAND = gemma_command()
PLINK_COMMAND = plink_command()
-FLAT_FILES = flat_files()
TEMPDIR = tempdir()