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
1931b7d9
Commit
1931b7d9
authored
Dec 13, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue_34' into development: closing issue #34
parents
b01a1e00
2c09a99b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
HISTORY.rst
+2
-0
pystache/template.py
+6
-1
pystache/view.py
+5
-1
No files found.
HISTORY.rst
View file @
1931b7d9
...
...
@@ -7,6 +7,8 @@ Next Release (version TBD)
accordance with the mustache spec. [heliodor]
* A custom template loader can now be passed to a View. [cjerdonek]
* Added a command-line interface. [vrde, cjerdonek]
* Bugfix: Fixed an issue that affected the rendering of zeroes when using
certain implementations of Python (i.e. PyPy). [alex]
* Added some docstrings. [kennethreitz]
0.4.0 (2011-01-12)
...
...
pystache/template.py
View file @
1931b7d9
...
...
@@ -166,7 +166,12 @@ class Template(object):
raw
=
self
.
view
.
get
(
tag_name
,
''
)
# For methods with no return value
if
not
raw
and
raw
is
not
0
:
#
# We use "==" rather than "is" to compare integers, as using "is" relies
# on an implementation detail of CPython. The test about rendering
# zeroes failed while using PyPy when using "is".
# See issue #34: https://github.com/defunkt/pystache/issues/34
if
not
raw
and
raw
!=
0
:
if
tag_name
==
'.'
:
raw
=
self
.
view
.
context_list
[
0
]
else
:
...
...
pystache/view.py
View file @
1931b7d9
...
...
@@ -139,7 +139,11 @@ class View(object):
def
__getitem__
(
self
,
attr
):
val
=
self
.
get
(
attr
,
None
)
if
not
val
and
val
is
not
0
:
# We use "==" rather than "is" to compare integers, as using "is" relies
# on an implementation detail of CPython. The test about rendering
# zeroes failed while using PyPy when using "is".
# See issue #34: https://github.com/defunkt/pystache/issues/34
if
not
val
and
val
!=
0
:
raise
KeyError
(
"Key '
%
s' does not exist in View"
%
attr
)
return
val
...
...
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