Commit e837155c by Chris Jerdonek

Switched the argument order of Locator.find_name() and Locator.find_object().

parent 423db900
......@@ -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)
......@@ -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.
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment