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
08b5173c
Commit
08b5173c
authored
Mar 20, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed custom_template.Loader.get_template() to custom_template.Loader.load().
parent
8431c10e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
pystache/custom_template.py
+12
-6
tests/test_custom_template.py
+2
-2
No files found.
pystache/custom_template.py
View file @
08b5173c
...
...
@@ -173,14 +173,20 @@ class Loader(object):
return
path
def
get_template
(
self
,
view
):
def
load
(
self
,
custom
):
"""
Return the unicode template string associated with a view.
Find and return the template associated to a CustomizedTemplate instance.
Returns the template as a unicode string.
Arguments:
custom: a CustomizedTemplate instance.
"""
if
view
.
template
is
not
None
:
return
self
.
reader
.
unicode
(
view
.
template
,
view
.
template_encoding
)
if
custom
.
template
is
not
None
:
return
self
.
reader
.
unicode
(
custom
.
template
,
custom
.
template_encoding
)
path
=
self
.
get_template_path
(
view
)
path
=
self
.
get_template_path
(
custom
)
return
self
.
reader
.
read
(
path
,
view
.
template_encoding
)
return
self
.
reader
.
read
(
path
,
custom
.
template_encoding
)
tests/test_custom_template.py
View file @
08b5173c
...
...
@@ -236,9 +236,9 @@ class LoaderTests(unittest.TestCase, AssertIsMixin):
self
.
assertEquals
(
actual
,
expected
)
def
_assert_get_template
(
self
,
view
,
expected
):
def
_assert_get_template
(
self
,
custom
,
expected
):
locator
=
self
.
_make_locator
()
actual
=
locator
.
get_template
(
view
)
actual
=
locator
.
load
(
custom
)
self
.
assertEquals
(
type
(
actual
),
unicode
)
self
.
assertEquals
(
actual
,
expected
)
...
...
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