From 9d0a0814f99ab1eae24c85485f03a06144927c74 Mon Sep 17 00:00:00 2001 From: Marko Mecina <marko.mecina@univie.ac.at> Date: Sat, 24 Sep 2022 12:29:58 +0200 Subject: [PATCH] replace hardcoded MIB name with get config --- Ccs/ccs_function_lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ccs/ccs_function_lib.py b/Ccs/ccs_function_lib.py index ff8e6b2..1507559 100644 --- a/Ccs/ccs_function_lib.py +++ b/Ccs/ccs_function_lib.py @@ -78,7 +78,7 @@ fmtlengthlist = {'b': 1, 'B': 1, 'h': 2, 'H': 2, 'i': 4, 'I': 4, 'q': 8, # get format and offset of HK SID SID_FORMAT = {1: '>B', 2: '>H', 4: '>I'} -_sidfmt = scoped_session_idb.execute('SELECT PIC_PI1_OFF,PIC_PI1_WID FROM mib_smile_sxi.pic where PIC_TYPE=3 and PIC_STYPE=25').fetchall() +_sidfmt = scoped_session_idb.execute('SELECT PIC_PI1_OFF,PIC_PI1_WID FROM {}.pic where PIC_TYPE=3 and PIC_STYPE=25'.format(cfg.get('ccs-database', 'idb_schema'))).fetchall() if len(_sidfmt) != 0: SID_OFFSET, SID_BITSIZE = _sidfmt[0] SID_SIZE = int(SID_BITSIZE / 8) @@ -2588,7 +2588,7 @@ def tc_load_to_memory(data, memid, mempos, slicesize=1000, sleep=0., ack=None, p def get_tc_descr_from_stsst(st, sst): - res = scoped_session_idb.execute('SELECT ccf_descr FROM mib_smile_sxi.ccf where ccf_type={} and ccf_stype={}'.format(st, sst)).fetchall() + res = scoped_session_idb.execute('SELECT ccf_descr FROM {}.ccf where ccf_type={} and ccf_stype={}'.format(cfg.get('ccs-database', 'idb_schema'), st, sst)).fetchall() return [x[0] for x in res] -- GitLab