From 71a859c9facc7ae49d43e3e995166ad8dcb586cb Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 17 Nov 2021 08:11:12 +0300 Subject: isolate SQL_URI parse to a function --- wqflask/base/data_set.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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""" -- cgit v1.2.3