From bf3426b8e4c21f5b2f152decbaf089a9d3b57727 Mon Sep 17 00:00:00 2001 From: Sean Dobbs Date: Wed, 16 Feb 2022 14:45:40 -0500 Subject: [PATCH] backport format strings to run on current GlueX software stack --- python/rcdb/alias.py | 2 +- python/rcdb/provider.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/rcdb/alias.py b/python/rcdb/alias.py index 0ec55fb..0afb31e 100644 --- a/python/rcdb/alias.py +++ b/python/rcdb/alias.py @@ -39,7 +39,7 @@ def __init__(self, name, expression, comment): collimator_diameter != 'Blocking'""", "Is production run with long mode data"), - ConditionSearchAlias('is_cosmic', "\"cosmic\" in run_config and beam_current < 1 and event_count > 5000", + ConditionSearchAlias('is_cosmic', '"cosmic" in run_config and beam_current < 1 and event_count > 5000', "Is cosmic run"), ConditionSearchAlias('is_empty_target', "target_type == 'EMPTY & Ready'", "Target is empty"), diff --git a/python/rcdb/provider.py b/python/rcdb/provider.py index d28a6f9..61f10c4 100644 --- a/python/rcdb/provider.py +++ b/python/rcdb/provider.py @@ -955,7 +955,7 @@ def select_values(self, val_names=None, search_str="", run_min=0, run_max=sys.ma compiled_search_eval = None result_table = [] - + for values in result: run = values[0] try: @@ -966,11 +966,11 @@ def select_values(self, val_names=None, search_str="", run_min=0, run_max=sys.ma result_row.append(val) result_table.append(result_row) except Exception as ex: - message = f'Error evaluating search query.\n' \ - f' Query: <<"{search_eval}">>, \n' \ - f' Names: {names}, \n' \ - f' Values: {values} \n' \ - f' Error: {ex}' + message = 'Error evaluating search query.\n' \ + + ' Query: <<"{}">>, \n'.format(search_eval) \ + + ' Names: {}, \n'.format(names) \ + + ' Values: {} \n'.format(values) \ + + ' Error: {}'.format(ex) raise QueryEvaluationError(msg=message) selection_sw.stop()