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
1542217e
Commit
1542217e
authored
Mar 31, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed CustomizedTemplate to TemplateSpec.
parent
ce5cc974
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
+12
-13
pystache/init.py
+2
-2
pystache/template_spec.py
+4
-5
tests/data/views.py
+3
-3
tests/test_template_spec.py
+3
-3
No files found.
pystache/init.py
View file @
1542217e
...
@@ -6,11 +6,11 @@ This module contains the initialization logic called by __init__.py.
...
@@ -6,11 +6,11 @@ This module contains the initialization logic called by __init__.py.
"""
"""
from
.template_spec
import
View
from
.template_spec
import
View
from
.template_spec
import
CustomizedTemplate
from
.template_spec
import
TemplateSpec
from
.renderer
import
Renderer
from
.renderer
import
Renderer
__all__
=
[
'render'
,
'Renderer'
,
'View'
,
'
CustomizedTemplate
'
]
__all__
=
[
'render'
,
'Renderer'
,
'View'
,
'
TemplateSpec
'
]
def
render
(
template
,
context
=
None
,
**
kwargs
):
def
render
(
template
,
context
=
None
,
**
kwargs
):
...
...
pystache/template_spec.py
View file @
1542217e
...
@@ -13,8 +13,7 @@ from .locator import Locator
...
@@ -13,8 +13,7 @@ from .locator import Locator
from
.renderer
import
Renderer
from
.renderer
import
Renderer
# TODO: consider renaming this to something like Template or TemplateInfo.
class
TemplateSpec
(
object
):
class
CustomizedTemplate
(
object
):
"""
"""
A mixin for specifying custom template information.
A mixin for specifying custom template information.
...
@@ -52,7 +51,7 @@ class CustomizedTemplate(object):
...
@@ -52,7 +51,7 @@ class CustomizedTemplate(object):
# TODO: remove this class.
# TODO: remove this class.
class
View
(
CustomizedTemplate
):
class
View
(
TemplateSpec
):
_renderer
=
None
_renderer
=
None
...
@@ -185,13 +184,13 @@ class CustomLoader(object):
...
@@ -185,13 +184,13 @@ class CustomLoader(object):
def
load
(
self
,
custom
):
def
load
(
self
,
custom
):
"""
"""
Find and return the template associated to a
CustomizedTemplate
instance.
Find and return the template associated to a
TemplateSpec
instance.
Returns the template as a unicode string.
Returns the template as a unicode string.
Arguments:
Arguments:
custom: a
CustomizedTemplate
instance.
custom: a
TemplateSpec
instance.
"""
"""
if
custom
.
template
is
not
None
:
if
custom
.
template
is
not
None
:
...
...
tests/data/views.py
View file @
1542217e
# coding: utf-8
# coding: utf-8
from
pystache
import
CustomizedTemplate
from
pystache
import
TemplateSpec
class
SayHello
(
object
):
class
SayHello
(
object
):
...
@@ -8,9 +8,9 @@ class SayHello(object):
...
@@ -8,9 +8,9 @@ class SayHello(object):
return
"World"
return
"World"
class
SampleView
(
CustomizedTemplate
):
class
SampleView
(
TemplateSpec
):
pass
pass
class
NonAscii
(
CustomizedTemplate
):
class
NonAscii
(
TemplateSpec
):
pass
pass
tests/test_template_spec.py
View file @
1542217e
...
@@ -13,7 +13,7 @@ from examples.simple import Simple
...
@@ -13,7 +13,7 @@ from examples.simple import Simple
from
examples.complex_view
import
ComplexView
from
examples.complex_view
import
ComplexView
from
examples.lambdas
import
Lambdas
from
examples.lambdas
import
Lambdas
from
examples.inverted
import
Inverted
,
InvertedLists
from
examples.inverted
import
Inverted
,
InvertedLists
from
pystache
import
CustomizedTemplate
as
Template
from
pystache
import
TemplateSpec
as
Template
from
pystache
import
Renderer
from
pystache
import
Renderer
from
pystache
import
View
from
pystache
import
View
from
pystache.template_spec
import
CustomLoader
from
pystache.template_spec
import
CustomLoader
...
@@ -255,8 +255,8 @@ class CustomLoaderTests(unittest.TestCase, AssertIsMixin, AssertStringMixin):
...
@@ -255,8 +255,8 @@ class CustomLoaderTests(unittest.TestCase, AssertIsMixin, AssertStringMixin):
# TODO: rename the get_template() tests to test load().
# TODO: rename the get_template() tests to test load().
# TODO: condense, reorganize, and rename the tests so that it is
# TODO: condense, reorganize, and rename the tests so that it is
# clear whether we have full test coverage (e.g. organized by
# clear whether we have full test coverage (e.g. organized by
#
CustomizedTemplate
attributes or something).
#
TemplateSpec
attributes or something).
class
CustomizedTemplate
Tests
(
unittest
.
TestCase
):
class
TemplateSpec
Tests
(
unittest
.
TestCase
):
# TODO: rename this method to _make_loader().
# TODO: rename this method to _make_loader().
def
_make_locator
(
self
):
def
_make_locator
(
self
):
...
...
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