Skip to content

Commit

Permalink
Switched the argument order of Locator.find_name() and Locator.find_o…
Browse files Browse the repository at this point in the history
…bject().
  • Loading branch information
cjerdonek committed Apr 1, 2012
1 parent 423db90 commit e837155
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pystache/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def load_name(self, name):
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)

Expand All @@ -150,6 +150,6 @@ def load_object(self, obj):
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)
4 changes: 2 additions & 2 deletions pystache/locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _find_path_required(self, search_dirs, file_name):

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.
Expand All @@ -132,7 +132,7 @@ def find_name(self, search_dirs, template_name):

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.
Expand Down
2 changes: 1 addition & 1 deletion pystache/template_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _find(self, spec):

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)
Expand Down

0 comments on commit e837155

Please sign in to comment.