From 41927004751731d2d0cb74989ded36878292ee4e Mon Sep 17 00:00:00 2001 From: Kartic Krishnamurthy Date: Tue, 6 May 2008 20:26:22 +0000 Subject: svn merge -r86582:86825 svn+ssh://svn/svn/linden/branches/nq-extension-for-merge-1 . Original Jira: https://jira.lindenlab.com/browse/DEV-11178 (Proposal: To rename named query files to take an extension .nq) Sandbox Jira: https://jira.lindenlab.com/browse/QAR-470 (Test a massive rename of named query files from being extensionless to having a .nq extension) Merge Buildme: https://jira.lindenlab.com/browse/QAR-473 Original Code Review: BillC --- indra/lib/python/indra/util/named_query.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3