aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-27 01:26:20 +0300
committerBonfaceKilz2020-08-27 01:42:45 +0300
commit5992562296aabdd51bc3575f36d16d1c245d9d1f (patch)
tree3d3530d52efff41bda6693b728f9ca58fdd4d405 /wqflask
parent391c1681eaeabfdbe65a64a1bb8b05beca30141e (diff)
downloadgenenetwork2-5992562296aabdd51bc3575f36d16d1c245d9d1f.tar.gz
Remove redundant methods which are defined elsewhere
* wqflask/base/data_set.py: Delete "create_in_clause", and "mescape" which are defined in "utility.db_tools"
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/base/data_set.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index ce017fb4..07704e4c 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -23,7 +23,9 @@ from utility.logger import getLogger
from utility.tools import USE_GN_SERVER, USE_REDIS, flat_files, flat_file_exists, GN2_BASE_URL
from db.gn_server import menu_main
from pprint import pformat as pf
-from MySQLdb import escape_string as escape
+from utility.db_tools import escape
+from utility.db_tools import mescape
+from utility.db_tools import create_in_clause
from maintenance import get_group_samplelists
from utility.tools import locate, locate_ignore_error, flat_files
from utility import gen_geno_ob
@@ -204,20 +206,6 @@ def create_datasets_list():
return datasets
-def create_in_clause(items):
- """Create an in clause for mysql"""
- in_clause = ', '.join("'{}'".format(x) for x in mescape(*items))
- in_clause = '( {} )'.format(in_clause)
- return in_clause
-
-
-def mescape(*items):
- """Multiple escape"""
- escaped = [escape(str(item)) for item in items]
- #logger.debug("escaped is:", escaped)
- return escaped
-
-
class Markers(object):
"""Todo: Build in cacheing so it saves us reading the same file more than once"""