summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-04-01 11:42:32 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-04-01 11:42:32 -0700
commite837155c158389d91f09adfb3af0413099e8dfd4 (patch)
tree2dedce902d1dadfb4bde1673d35ce7f1775b94e6
parent423db900a6b3b447c15f292c14b6fb794af18061 (diff)
downloadpystache-e837155c158389d91f09adfb3af0413099e8dfd4.tar.gz
Switched the argument order of Locator.find_name() and Locator.find_object().
-rw-r--r--pystache/loader.py4
-rw-r--r--pystache/locator.py4
-rw-r--r--pystache/template_spec.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/pystache/loader.py b/pystache/loader.py
index 670fcb7..760789e 100644
--- a/pystache/loader.py
+++ b/pystache/loader.py
@@ -131,7 +131,7 @@ class Loader(object):
locator = self._make_locator()
# TODO: change the order of these arguments.
- path = locator.find_name(self.search_dirs, name)
+ path = locator.find_name(name, self.search_dirs)
return self.read(path)
@@ -150,6 +150,6 @@ class Loader(object):
locator = self._make_locator()
# TODO: change the order of these arguments.
- path = locator.find_object(self.search_dirs, obj)
+ path = locator.find_object(obj, self.search_dirs)
return self.read(path)
diff --git a/pystache/locator.py b/pystache/locator.py
index 05bb445..e288049 100644
--- a/pystache/locator.py
+++ b/pystache/locator.py
@@ -123,7 +123,7 @@ class Locator(object):
return path
- def find_name(self, search_dirs, template_name):
+ def find_name(self, template_name, search_dirs):
"""
Return the path to a template with the given name.
@@ -132,7 +132,7 @@ class Locator(object):
return self._find_path_required(search_dirs, file_name)
- def find_object(self, search_dirs, obj, file_name=None):
+ def find_object(self, obj, search_dirs, file_name=None):
"""
Return the path to a template associated with the given object.
diff --git a/pystache/template_spec.py b/pystache/template_spec.py
index b554261..83aebfd 100644
--- a/pystache/template_spec.py
+++ b/pystache/template_spec.py
@@ -175,7 +175,7 @@ class SpecLoader(object):
if dir_path is None:
# Then we need to search for the path.
- path = locator.find_object(self.search_dirs, spec, file_name=file_name)
+ path = locator.find_object(spec, self.search_dirs, file_name=file_name)
else:
obj_dir = locator.get_object_directory(spec)
path = os.path.join(obj_dir, dir_path, file_name)