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
679ba6a9
Commit
679ba6a9
authored
May 02, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed value to result in ContextStack.get().
parent
1ef4f906
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
pystache/context.py
+5
-5
No files found.
pystache/context.py
View file @
679ba6a9
...
@@ -191,12 +191,12 @@ class ContextStack(object):
...
@@ -191,12 +191,12 @@ class ContextStack(object):
parts
=
name
.
split
(
'.'
)
parts
=
name
.
split
(
'.'
)
value
=
self
.
_get_simple
(
parts
[
0
])
result
=
self
.
_get_simple
(
parts
[
0
])
for
part
in
parts
[
1
:]:
for
part
in
parts
[
1
:]:
# TODO: consider using EAFP here instead.
# TODO: consider using EAFP here instead.
# http://docs.python.org/glossary.html#term-eafp
# http://docs.python.org/glossary.html#term-eafp
if
value
is
_NOT_FOUND
:
if
result
is
_NOT_FOUND
:
break
break
# The full context stack is not used to resolve the remaining parts.
# The full context stack is not used to resolve the remaining parts.
# From the spec--
# From the spec--
...
@@ -208,12 +208,12 @@ class ContextStack(object):
...
@@ -208,12 +208,12 @@ class ContextStack(object):
# the empty string.
# the empty string.
#
#
# TODO: make sure we have a test case for the above point.
# TODO: make sure we have a test case for the above point.
value
=
_get_value
(
value
,
part
)
result
=
_get_value
(
result
,
part
)
if
value
is
_NOT_FOUND
:
if
result
is
_NOT_FOUND
:
return
default
return
default
return
value
return
result
# TODO: combine the docstring for this method with the docstring for
# TODO: combine the docstring for this method with the docstring for
# the get() method.
# the get() method.
...
...
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