From b541caecff9ecd14545ca16f9fe278c29fbaf4a3 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 4 Dec 2009 16:21:01 +0000 Subject: - Operation on GAE was broken, presumably because the ``repoze.bfg.configuration`` module began to attempt to import the ``repoze.bfg.chameleon_zpt`` and ``repoze.bfg.chameleon_text`` modules, and these cannot be used on non-CPython platforms. It now tolerates startup time import failures for these modules, and only raise an import error when a template from one of these packages is actually used. --- repoze/bfg/chameleon_zpt.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'repoze/bfg/chameleon_zpt.py') diff --git a/repoze/bfg/chameleon_zpt.py b/repoze/bfg/chameleon_zpt.py index 270ad6394..bc1a5d22f 100644 --- a/repoze/bfg/chameleon_zpt.py +++ b/repoze/bfg/chameleon_zpt.py @@ -2,7 +2,13 @@ from webob import Response from zope.interface import implements -from chameleon.zpt.template import PageTemplateFile +try: + from chameleon.zpt.template import PageTemplateFile +except ImportError, why: # pragma: no cover + # Chameleon doesn't work on non-CPython platforms + class PageTemplateFile(object): + def __init__(self, *arg, **kw): + raise ImportError(why[0]) from repoze.bfg.interfaces import IResponseFactory from repoze.bfg.interfaces import ITemplateRenderer -- cgit v1.2.3