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
09363d96
Commit
09363d96
authored
Jan 02, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made non_blank regular expression an attribute.
parent
62f8640d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
pystache/renderengine.py
+3
-2
No files found.
pystache/renderengine.py
View file @
09363d96
...
...
@@ -91,6 +91,8 @@ class RenderEngine(object):
otag
=
DEFAULT_TAG_OPENING
ctag
=
DEFAULT_TAG_CLOSING
nonblank_re
=
re
.
compile
(
r'^(.)'
,
re
.
M
)
def
__init__
(
self
,
load_partial
=
None
,
literal
=
None
,
escape
=
None
):
"""
Arguments:
...
...
@@ -268,10 +270,9 @@ class RenderEngine(object):
Returns: a string of type unicode.
"""
nonblank
=
re
.
compile
(
r'^(.)'
,
re
.
M
)
template
=
self
.
load_partial
(
name
)
# Indent before rendering.
template
=
re
.
sub
(
nonblank
,
indentation
+
r'\1'
,
template
)
template
=
re
.
sub
(
self
.
nonblank_re
,
indentation
+
r'\1'
,
template
)
return
self
.
_render_template
(
template
,
context
)
return
get_partial
...
...
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