summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-03-31 09:53:29 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-03-31 09:53:29 -0700
commit1542217e351fd9c45d25178e0fc92a91a5449cee (patch)
tree900c80ce71eb1d481a2a00125f82acfec88be16e
parentce5cc9748c8929a045d3993790bd01ee51fc7020 (diff)
downloadpystache-1542217e351fd9c45d25178e0fc92a91a5449cee.tar.gz
Renamed CustomizedTemplate to TemplateSpec.
-rw-r--r--pystache/init.py4
-rw-r--r--pystache/template_spec.py9
-rw-r--r--tests/data/views.py6
-rw-r--r--tests/test_template_spec.py6
4 files changed, 12 insertions, 13 deletions
diff --git a/pystache/init.py b/pystache/init.py
index ab59440..5ca096a 100644
--- a/pystache/init.py
+++ b/pystache/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 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):
diff --git a/pystache/template_spec.py b/pystache/template_spec.py
index 5f6a79b..1fd54a9 100644
--- a/pystache/template_spec.py
+++ b/pystache/template_spec.py
@@ -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:
diff --git a/tests/data/views.py b/tests/data/views.py
index b96d968..4d9df02 100644
--- a/tests/data/views.py
+++ b/tests/data/views.py
@@ -1,6 +1,6 @@
# 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
diff --git a/tests/test_template_spec.py b/tests/test_template_spec.py
index 7e208c6..7947de9 100644
--- a/tests/test_template_spec.py
+++ b/tests/test_template_spec.py
@@ -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):