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
a0feb641
Commit
a0feb641
authored
May 05, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documented parse().
parent
2aaa7a28
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
3 deletions
+11
-3
HISTORY.rst
+1
-0
README.rst
+6
-0
pystache/__init__.py
+2
-2
pystache/init.py
+1
-0
pystache/tests/test___init__.py
+1
-1
No files found.
HISTORY.rst
View file @
a0feb641
...
...
@@ -6,6 +6,7 @@ History
* Added option of raising errors on missing tags/partials:
``Renderer(missing_tags='strict')`` (issue #110).
* Added a ``parse()`` function that yields a printable parse tree.
* Bugfix: exceptions raised from a property are no longer swallowed when
getting a key from a context stack (issue #110).
* Bugfix: lambda section values can now return non-ascii, non-unicode strings (issue #118).
...
...
README.rst
View file @
a0feb641
...
...
@@ -95,6 +95,12 @@ To customize template loading on a per-view basis, subclass ``TemplateSpec``.
See the docstrings of the Renderer_ class and TemplateSpec_ class for
more information.
Try parsing a template: ::
>>> from pystache import parse
>>> parse("Hey {{#you}}{{.}}!{{/you}}")
['Hey ', _SectionNode(key='you', index_begin=12, index_end=18, parsed=[_EscapeNode(key='.'), '!'])]
Python 3
========
...
...
pystache/__init__.py
View file @
a0feb641
...
...
@@ -6,8 +6,8 @@ TODO: add a docstring.
# We keep all initialization code in a separate module.
from
pystache.init
import
render
,
Renderer
,
TemplateSpec
from
pystache.init
import
parse
,
render
,
Renderer
,
TemplateSpec
__all__
=
[
'render'
,
'Renderer'
,
'TemplateSpec'
]
__all__
=
[
'
parse'
,
'
render'
,
'Renderer'
,
'TemplateSpec'
]
__version__
=
'0.5.2-rc.1'
# Also change in setup.py.
pystache/init.py
View file @
a0feb641
...
...
@@ -5,6 +5,7 @@ This module contains the initialization logic called by __init__.py.
"""
from
pystache.parser
import
parse
from
pystache.renderer
import
Renderer
from
pystache.template_spec
import
TemplateSpec
...
...
pystache/tests/test___init__.py
View file @
a0feb641
...
...
@@ -23,7 +23,7 @@ class InitTests(unittest.TestCase):
"""
actual
=
set
(
GLOBALS_PYSTACHE_IMPORTED
)
-
set
(
GLOBALS_INITIAL
)
expected
=
set
([
'render'
,
'Renderer'
,
'TemplateSpec'
,
'GLOBALS_INITIAL'
])
expected
=
set
([
'
parse'
,
'
render'
,
'Renderer'
,
'TemplateSpec'
,
'GLOBALS_INITIAL'
])
self
.
assertEqual
(
actual
,
expected
)
...
...
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