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
69c44762
Commit
69c44762
authored
May 03, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the partial-loading code from the parser module to the renderengine module.
parent
170c65df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
pystache/parser.py
+1
-8
pystache/renderengine.py
+7
-0
No files found.
pystache/parser.py
View file @
69c44762
...
...
@@ -9,7 +9,6 @@ This module is only meant for internal use by the renderengine module.
import
re
from
pystache.common
import
TemplateNotFoundError
from
pystache.parsed
import
ParsedTemplate
...
...
@@ -216,15 +215,9 @@ class Parser(object):
elif
tag_type
==
'>'
:
try
:
# TODO: make engine.load() and test it separately.
template
=
engine
.
load_partial
(
tag_key
)
except
TemplateNotFoundError
:
template
=
u''
template
=
engine
.
read_partial
(
tag_key
)
# Indent before rendering.
template
=
re
.
sub
(
NON_BLANK_RE
,
leading_whitespace
+
ur'\1'
,
template
)
func
=
engine
.
_make_get_partial
(
template
)
else
:
...
...
pystache/renderengine.py
View file @
69c44762
...
...
@@ -7,6 +7,7 @@ Defines a class responsible for rendering logic.
import
re
from
pystache.common
import
TemplateNotFoundError
from
pystache.parser
import
Parser
...
...
@@ -65,6 +66,12 @@ class RenderEngine(object):
self
.
load_partial
=
load_partial
# TODO: rename context to stack throughout this module.
def
read_partial
(
self
,
key
):
try
:
return
self
.
load_partial
(
key
)
except
TemplateNotFoundError
:
return
u''
def
_get_string_value
(
self
,
context
,
tag_name
):
"""
Get a value from the given context as a basestring instance.
...
...
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