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
12f5ad2b
Commit
12f5ad2b
authored
Dec 31, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed some variables in _handle_match().
parent
b4f6f97d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
pystache/template.py
+10
-6
No files found.
pystache/template.py
View file @
12f5ad2b
...
...
@@ -3,6 +3,10 @@ import cgi
import
inspect
import
types
END_OF_LINE_CHARACTERS
=
[
'
\r
'
,
'
\n
'
]
def
call
(
val
,
view
,
template
=
None
):
if
callable
(
val
):
(
args
,
_
,
_
,
_
)
=
inspect
.
getargspec
(
val
)
...
...
@@ -162,18 +166,18 @@ class Template(object):
elif
captures
[
'raw'
]
is
not
None
:
captures
.
update
(
tag
=
'{'
,
name
=
captures
[
'raw_name'
])
# Save the literal text content.
parse_tree
.
append
(
captures
[
'content'
])
end_index
=
match
.
end
()
match_index
=
match
.
end
(
'content'
)
end_index
=
match
.
end
()
# Standalone (non-interpolation) tags consume the entire line,
# both leading whitespace and trailing newline.
tagBeganLine
=
not
match_index
or
template
[
match_index
-
1
]
in
[
'
\r
'
,
'
\n
'
]
tagEndedLine
=
(
end_index
==
len
(
template
)
or
template
[
end_index
]
in
[
'
\r
'
,
'
\n
'
])
i
nterpolationTa
g
=
captures
[
'tag'
]
in
[
''
,
'&'
,
'{'
]
did_tag_begin_line
=
match_index
==
0
or
template
[
match_index
-
1
]
in
END_OF_LINE_CHARACTERS
did_tag_end_line
=
end_index
==
len
(
template
)
or
template
[
end_index
]
in
END_OF_LINE_CHARACTERS
i
s_tag_interpolatin
g
=
captures
[
'tag'
]
in
[
''
,
'&'
,
'{'
]
if
(
tagBeganLine
and
tagEndedLine
and
not
interpolationTag
)
:
if
did_tag_begin_line
and
did_tag_end_line
and
not
is_tag_interpolating
:
if
end_index
<
len
(
template
):
end_index
+=
template
[
end_index
]
==
'
\r
'
and
1
or
0
if
end_index
<
len
(
template
):
...
...
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