summaryrefslogtreecommitdiff
path: root/pystache
diff options
context:
space:
mode:
authorxgecko <jonathan@xgecko.com>2012-07-21 17:46:50 -0700
committerxgecko <jonathan@xgecko.com>2012-07-21 17:46:50 -0700
commita111e91673bcc7c7ec765e6c92aa2395f7e5eafe (patch)
tree842441e52bb9569670a412b731591fea19b20f08 /pystache
parent2b07ad52a45fb109c981dd505f63eade84be8558 (diff)
downloadpystache-a111e91673bcc7c7ec765e6c92aa2395f7e5eafe.tar.gz
Added find_file function, and remove extension check logic from make_file_name
Diffstat (limited to 'pystache')
-rw-r--r--pystache/locator.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pystache/locator.py b/pystache/locator.py
index 04260bd..9bb095a 100644
--- a/pystache/locator.py
+++ b/pystache/locator.py
@@ -91,7 +91,7 @@ class Locator(object):
if template_extension is None:
template_extension = self.template_extension
- if template_extension is not False and not file_name.endswith(template_extension):
+ if template_extension is not False:
file_name += os.path.extsep + template_extension
return file_name
@@ -123,6 +123,13 @@ class Locator(object):
return path
+ def find_file(self, template_file, search_dirs):
+ """
+ Return the path to a template with the given file name.
+
+ """
+ return self._find_path_required(search_dirs, template_file)
+
def find_name(self, template_name, search_dirs):
"""
Return the path to a template with the given name.