aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorAlexander Kabui2021-11-17 08:11:12 +0300
committerAlexander Kabui2021-11-17 08:11:12 +0300
commit71a859c9facc7ae49d43e3e995166ad8dcb586cb (patch)
treea843ce1c0d47fea51f78b3c35cfc9bbaf9947487 /wqflask
parent60fe836dc6c2f00cb99844572eb3fd29aee0163e (diff)
downloadgenenetwork2-71a859c9facc7ae49d43e3e995166ad8dcb586cb.tar.gz
isolate SQL_URI parse to a function
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/base/data_set.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 2e401c8e..f0a930a5 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -40,7 +40,8 @@ from base import species
from base import webqtlConfig
from flask import Flask, g
from base.webqtlConfig import TMPDIR
-from gn3.db_utils import parse_db_url
+from urllib.parse import urlparse
+from utility.tools import SQL_URI
import os
import math
import string
@@ -1257,6 +1258,13 @@ def geno_mrna_confidentiality(ob):
return True
+
+def parse_db_url():
+ parsed_db = urlparse(SQL_URI)
+
+ return (parsed_db.hostname, parsed_db.username,
+ parsed_db.password, parsed_db.path[1:])
+
def query_table_timestamp(dataset_type: str):
"""function to query the update timestamp of a given dataset_type"""