Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
e837155c
Commit
e837155c
authored
Apr 01, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched the argument order of Locator.find_name() and Locator.find_object().
parent
423db900
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
pystache/loader.py
+2
-2
pystache/locator.py
+2
-2
pystache/template_spec.py
+1
-1
No files found.
pystache/loader.py
View file @
e837155c
...
...
@@ -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
)
pystache/locator.py
View file @
e837155c
...
...
@@ -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.
...
...
pystache/template_spec.py
View file @
e837155c
...
...
@@ -175,7 +175,7 @@ class SpecLoader(object):
if
dir_path
is
None
:
# Then we need to search for the path.
path
=
locator
.
find_object
(
s
elf
.
search_dirs
,
spec
,
file_name
=
file_name
)
path
=
locator
.
find_object
(
s
pec
,
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment