aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-06-16 10:53:08 +0300
committerFrederick Muriuki Muriithi2023-06-20 13:36:50 +0300
commit883a7cba581f34eba48978746e2ff8bbb93020d8 (patch)
tree433c1b0b6db451b841810b2fdb4f2fd07bc9377b /wqflask/base
parent7127095f2b2c54175d1360c1ddb3e0f87b6ede98 (diff)
downloadgenenetwork2-883a7cba581f34eba48978746e2ff8bbb93020d8.tar.gz
Add `create_app()` application factory
Create the application and set up configs and other things within an application factory function. Fix obvious egregious errors preventing the application from starting up correctly.
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/data_set/__init__.py2
-rw-r--r--wqflask/base/data_set/datasetgroup.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/base/data_set/__init__.py b/wqflask/base/data_set/__init__.py
index ad51e47e..c2c0aef1 100644
--- a/wqflask/base/data_set/__init__.py
+++ b/wqflask/base/data_set/__init__.py
@@ -115,7 +115,7 @@ def datasets(group_name, this_group=None, redis_conn=Redis()):
dataset_menu.append(dict(tissue=tissue_name,
datasets=[(dataset, dataset_short)]))
- if get_setting_bool("USE_REDIS"):
+ if get_setting_bool(app, "USE_REDIS"):
redis_conn.set(key, pickle.dumps(dataset_menu, pickle.HIGHEST_PROTOCOL))
redis_conn.expire(key, 60 * 5)
diff --git a/wqflask/base/data_set/datasetgroup.py b/wqflask/base/data_set/datasetgroup.py
index 90c59a1e..a44cf18d 100644
--- a/wqflask/base/data_set/datasetgroup.py
+++ b/wqflask/base/data_set/datasetgroup.py
@@ -15,6 +15,7 @@ from wqflask.database import database_connection
from utility.configuration import (
locate,
flat_files,
+ get_setting,
flat_file_exists,
get_setting_bool,
locate_ignore_error)
@@ -128,7 +129,7 @@ class DatasetGroup:
return study_samples
def get_genofiles(self):
- jsonfile = "%s/%s.json" % (webqtlConfig.GENODIR, self.name)
+ jsonfile = "%s/%s.json" % (get_setting(app, "WEBQTL_GENODIR"), self.name)
try:
f = open(jsonfile)
except: