Commit 5e77ac5e authored by Evan Simpson's avatar Evan Simpson

Brought into line with cDocumentTemplate __render_with_namespace__ changes

parent 34dedeb1
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
__doc__='''Python implementations of document template some features __doc__='''Python implementations of document template some features
$Id: pDocumentTemplate.py,v 1.25 2000/06/19 14:26:12 shane Exp $''' $Id: pDocumentTemplate.py,v 1.26 2000/12/19 16:20:44 evan Exp $'''
__version__='$Revision: 1.25 $'[11:-2] __version__='$Revision: 1.26 $'[11:-2]
import string, sys, types import string, sys, types
from string import join from string import join
...@@ -203,21 +203,15 @@ class TemplateDict: ...@@ -203,21 +203,15 @@ class TemplateDict:
isFunctionType=isFunctionType, isFunctionType=isFunctionType,
): ):
v=self.dicts[key] v = self.dicts[key]
if call and not simple(type(v)): if call:
if hasattr(v,'isDocTemp') and v.isDocTemp: return v(None, self) if hasattr(v, '__render_with_namespace__'):
elif isFunctionType(type(v)): return v() return v.__render_with_namespace__(self)
else: vbase = getattr(v, 'aq_base', v)
try: return v() if callable(vbase):
except AttributeError, ev: if getattr(vbase, 'isDocTemp', None):
try: return v(None, self)
tb=sys.exc_traceback return v()
if hasattr(sys, 'exc_info'): tb=sys.exc_info()[2]
if hasattr(v,'__call__'):
raise AttributeError, ev, tb
finally: tb=None
except TypeError: pass
return v return v
def has_key(self,key): def has_key(self,key):
......
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