Commit 1542217e by Chris Jerdonek

Renamed CustomizedTemplate to TemplateSpec.

parent ce5cc974
......@@ -6,11 +6,11 @@ This module contains the initialization logic called by __init__.py.
"""
from .template_spec import View
from .template_spec import CustomizedTemplate
from .template_spec import TemplateSpec
from .renderer import Renderer
__all__ = ['render', 'Renderer', 'View', 'CustomizedTemplate']
__all__ = ['render', 'Renderer', 'View', 'TemplateSpec']
def render(template, context=None, **kwargs):
......
......@@ -13,8 +13,7 @@ from .locator import Locator
from .renderer import Renderer
# TODO: consider renaming this to something like Template or TemplateInfo.
class CustomizedTemplate(object):
class TemplateSpec(object):
"""
A mixin for specifying custom template information.
......@@ -52,7 +51,7 @@ class CustomizedTemplate(object):
# TODO: remove this class.
class View(CustomizedTemplate):
class View(TemplateSpec):
_renderer = None
......@@ -185,13 +184,13 @@ class CustomLoader(object):
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.
Arguments:
custom: a CustomizedTemplate instance.
custom: a TemplateSpec instance.
"""
if custom.template is not None:
......
# coding: utf-8
from pystache import CustomizedTemplate
from pystache import TemplateSpec
class SayHello(object):
......@@ -8,9 +8,9 @@ class SayHello(object):
return "World"
class SampleView(CustomizedTemplate):
class SampleView(TemplateSpec):
pass
class NonAscii(CustomizedTemplate):
class NonAscii(TemplateSpec):
pass
......@@ -13,7 +13,7 @@ from examples.simple import Simple
from examples.complex_view import ComplexView
from examples.lambdas import Lambdas
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 View
from pystache.template_spec import CustomLoader
......@@ -255,8 +255,8 @@ class CustomLoaderTests(unittest.TestCase, AssertIsMixin, AssertStringMixin):
# TODO: rename the get_template() tests to test load().
# TODO: condense, reorganize, and rename the tests so that it is
# clear whether we have full test coverage (e.g. organized by
# CustomizedTemplate attributes or something).
class CustomizedTemplateTests(unittest.TestCase):
# TemplateSpec attributes or something).
class TemplateSpecTests(unittest.TestCase):
# TODO: rename this method to _make_loader().
def _make_locator(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment