From 5992562296aabdd51bc3575f36d16d1c245d9d1f Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 27 Aug 2020 01:26:20 +0300 Subject: 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" --- wqflask/base/data_set.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'wqflask/base') 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""" -- cgit v1.2.3