summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/lib/python/indra/util/named_query.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/lib/python/indra/util/named_query.py b/indra/lib/python/indra/util/named_query.py
index 471998388d..17f25f46d2 100644
--- a/indra/lib/python/indra/util/named_query.py
+++ b/indra/lib/python/indra/util/named_query.py
@@ -47,6 +47,9 @@ except NameError:
from indra.base import llsd
from indra.base import config
+NQ_FILE_SUFFIX = config.get('named-query-file-suffix', '')
+NQ_FILE_SUFFIX_LEN = len(NQ_FILE_SUFFIX)
+
_g_named_manager = None
def _init_g_named_manager(sql_dir = None):
@@ -98,6 +101,9 @@ class NamedQuery(object):
a path to a file containing an llsd named query document."""
self._stat_interval_seconds = 5 # 5 seconds
self._name = name
+ if (filename is not None) \
+ and (NQ_FILE_SUFFIX != filename[-NQ_FILE_SUFFIX_LEN:]):
+ filename = filename + NQ_FILE_SUFFIX
self._location = filename
self._alternative = dict()
self._last_mod_time = 0