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
9497c957
Commit
9497c957
authored
Dec 31, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6 more tests passing: handle call() returning None.
Now at-- Ran 160 tests in 0.755s FAILED (errors=1, failures=18)
parent
444b0dc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
pystache/template.py
+8
-2
No files found.
pystache/template.py
View file @
9497c957
...
...
@@ -23,6 +23,10 @@ def call(val, view, template=None):
val
=
val
(
template
)
else
:
val
=
val
(
view
,
template
)
if
val
is
None
:
val
=
''
return
unicode
(
val
)
def
parse
(
template
,
view
,
delims
=
(
'{{'
,
'}}'
)):
...
...
@@ -34,7 +38,8 @@ def parse(template, view, delims=('{{', '}}')):
def
renderParseTree
(
parsed
,
view
,
template
):
n
=
len
(
parsed
)
return
''
.
join
(
map
(
call
,
parsed
,
[
view
]
*
n
,
[
template
]
*
n
))
parts
=
map
(
call
,
parsed
,
[
view
]
*
n
,
[
template
]
*
n
)
return
''
.
join
(
parts
)
def
render
(
template
,
view
,
delims
=
(
'{{'
,
'}}'
)):
parseTree
=
parse
(
template
,
view
,
delims
)
...
...
@@ -84,7 +89,8 @@ def escapedTag(name, delims):
def
unescapedTag
(
name
,
delims
):
def
func
(
context
):
template
=
call
(
val
=
context
.
get
(
name
),
view
=
context
)
val
=
context
.
get
(
name
)
template
=
call
(
val
=
val
,
view
=
context
)
return
unicode
(
render
(
template
,
context
))
return
func
...
...
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