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
5d2fe4f2
Commit
5d2fe4f2
authored
Dec 29, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created Renderer._render_string().
parent
f5c8a965
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
pystache/renderer.py
+16
-8
No files found.
pystache/renderer.py
View file @
5d2fe4f2
...
@@ -255,6 +255,21 @@ class Renderer(object):
...
@@ -255,6 +255,21 @@ class Renderer(object):
load_template
=
self
.
_make_load_template
()
load_template
=
self
.
_make_load_template
()
return
load_template
(
template_name
)
return
load_template
(
template_name
)
def
_render_string
(
self
,
template
,
*
context
,
**
kwargs
):
"""
Render the given template string using the given context.
"""
# RenderEngine.render() requires that the template string be unicode.
template
=
self
.
_to_unicode_hard
(
template
)
context
=
Context
.
create
(
*
context
,
**
kwargs
)
engine
=
self
.
_make_render_engine
()
rendered
=
engine
.
render
(
template
,
context
)
return
unicode
(
rendered
)
def
render_path
(
self
,
template_path
,
*
context
,
**
kwargs
):
def
render_path
(
self
,
template_path
,
*
context
,
**
kwargs
):
"""
"""
Render the template at the given path using the given context.
Render the template at the given path using the given context.
...
@@ -290,12 +305,5 @@ class Renderer(object):
...
@@ -290,12 +305,5 @@ class Renderer(object):
all items in the *context list.
all items in the *context list.
"""
"""
engine
=
self
.
_make_render_engine
()
return
self
.
_render_string
(
template
,
*
context
,
**
kwargs
)
context
=
Context
.
create
(
*
context
,
**
kwargs
)
# RenderEngine.render() requires that the template string be unicode.
template
=
self
.
_to_unicode_hard
(
template
)
rendered
=
engine
.
render
(
template
,
context
)
return
unicode
(
rendered
)
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