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
c39b8b84
Commit
c39b8b84
authored
Mar 19, 2011
by
Pieter van de Bruggen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing some basic Partial rendering problems.
parent
5c9bdd56
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
pystache/template.py
+3
-2
tests/test_spec.py
+1
-0
No files found.
pystache/template.py
View file @
c39b8b84
...
@@ -5,7 +5,6 @@ import inspect
...
@@ -5,7 +5,6 @@ import inspect
def
call
(
view
,
x
,
template
=
None
):
def
call
(
view
,
x
,
template
=
None
):
if
callable
(
x
):
if
callable
(
x
):
(
args
,
_
,
_
,
_
)
=
inspect
.
getargspec
(
x
)
(
args
,
_
,
_
,
_
)
=
inspect
.
getargspec
(
x
)
print
args
if
len
(
args
)
is
0
:
if
len
(
args
)
is
0
:
x
=
x
()
x
=
x
()
elif
len
(
args
)
is
1
and
args
[
0
]
==
'self'
:
elif
len
(
args
)
is
1
and
args
[
0
]
==
'self'
:
...
@@ -151,7 +150,9 @@ class Template(object):
...
@@ -151,7 +150,9 @@ class Template(object):
self
.
otag
,
self
.
ctag
=
name
.
split
()
self
.
otag
,
self
.
ctag
=
name
.
split
()
self
.
_compile_regexps
()
self
.
_compile_regexps
()
elif
captures
[
'tag'
]
==
'>'
:
elif
captures
[
'tag'
]
==
'>'
:
buffer
+=
self
.
_parse
(
self
.
view
.
partial
(
name
))
tmpl
=
Template
(
self
.
view
.
partial
(
name
))
tmpl
.
view
=
self
.
view
buffer
+=
tmpl
.
_parse
()
elif
captures
[
'tag'
]
in
[
'#'
,
'^'
]:
elif
captures
[
'tag'
]
in
[
'#'
,
'^'
]:
try
:
try
:
self
.
_parse
(
template
,
name
,
pos
)
self
.
_parse
(
template
,
name
,
pos
)
...
...
tests/test_spec.py
View file @
c39b8b84
...
@@ -31,6 +31,7 @@ def buildTest(testData, spec):
...
@@ -31,6 +31,7 @@ def buildTest(testData, spec):
files
.
append
(
os
.
path
.
join
(
Loader
.
template_path
,
filename
))
files
.
append
(
os
.
path
.
join
(
Loader
.
template_path
,
filename
))
p
=
open
(
files
[
-
1
],
'w'
)
p
=
open
(
files
[
-
1
],
'w'
)
p
.
write
(
partials
[
key
])
p
.
write
(
partials
[
key
])
p
.
close
()
self
.
assertEquals
(
pystache
.
render
(
template
,
data
),
expected
)
self
.
assertEquals
(
pystache
.
render
(
template
,
data
),
expected
)
finally
:
finally
:
[
os
.
remove
(
f
)
for
f
in
files
]
[
os
.
remove
(
f
)
for
f
in
files
]
...
...
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