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)