Mercurial > p > roundup > code
changeset 4720:fd72576e07ed
API break: rename Templates to Loader for zopetal and chameleon
engines.
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Sun, 06 Jan 2013 16:36:33 +0300 |
| parents | 05fe39f1d823 |
| children | ec359e7c6c95 |
| files | CHANGES.txt roundup/cgi/engine_chameleon.py roundup/cgi/engine_zopetal.py roundup/cgi/templating.py roundup/instance.py test/test_templating.py |
| diffstat | 6 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Sun Jan 06 16:02:45 2013 +0300 +++ b/CHANGES.txt Sun Jan 06 16:36:33 2013 +0300 @@ -10,6 +10,8 @@ - API changes. Renamed templating members to correctly reflect the purpose of classes and avoid confusion (anatoly techtonik) templating.TemplatesBase -> templating.LoaderBase + engine_chameleon.Templates -> engine_chameleon.Loader + engine_zopetal.Templates -> engine_zopetal.Loader Fixed:
--- a/roundup/cgi/engine_chameleon.py Sun Jan 06 16:02:45 2013 +0300 +++ b/roundup/cgi/engine_chameleon.py Sun Jan 06 16:36:33 2013 +0300 @@ -3,14 +3,14 @@ __docformat__ = 'restructuredtext' import os.path -from chameleon import PageTemplateLoader +import chameleon from roundup.cgi.templating import StringIO, context, find_template, LoaderBase -class Templates(LoaderBase): +class Loader(LoaderBase): def __init__(self, dir): self.dir = dir - self.loader = PageTemplateLoader(dir) + self.loader = chameleon.PageTemplateLoader(dir) def get(self, name, extension=None): # default the name to "home"
--- a/roundup/cgi/engine_zopetal.py Sun Jan 06 16:02:45 2013 +0300 +++ b/roundup/cgi/engine_zopetal.py Sun Jan 06 16:36:33 2013 +0300 @@ -15,7 +15,7 @@ GlobalTranslationService.setGlobalTranslationService(translationService) -class Templates(LoaderBase): +class Loader(LoaderBase): templates = {} def __init__(self, dir):
--- a/roundup/cgi/templating.py Sun Jan 06 16:02:45 2013 +0300 +++ b/roundup/cgi/templating.py Sun Jan 06 16:36:33 2013 +0300 @@ -160,7 +160,7 @@ import engine_chameleon as engine else: import engine_zopetal as engine - return engine.Templates(dir) + return engine.Loader(dir) def context(client, template=None, classname=None, request=None): """Return the rendering context dictionary
--- a/roundup/instance.py Sun Jan 06 16:02:45 2013 +0300 +++ b/roundup/instance.py Sun Jan 06 16:36:33 2013 +0300 @@ -288,6 +288,8 @@ tracker.dbinit.config = tracker.config tracker.optimize = optimize + # [ ] this path doesn't seem to work anymore in 1.4.21 + # check and cleanup, also fix the docs tracker.templates = templating.Templates(tracker.config["TEMPLATES"]) if optimize: tracker.templates.precompileTemplates()
--- a/test/test_templating.py Sun Jan 06 16:02:45 2013 +0300 +++ b/test/test_templating.py Sun Jan 06 16:36:33 2013 +0300 @@ -338,7 +338,7 @@ def __str__(self): def find_template(dir, name, extension): -class Templates: +class Loader: def __init__(self, dir): def precompileTemplates(self): def get(self, name, extension=None):
