Commit 31bdc1c2 authored by Shane Hathaway's avatar Shane Hathaway

Brought up to date with cDocumentTemplate wrt __render_with_namespace__.

parent 5e77ac5e
...@@ -82,8 +82,8 @@ ...@@ -82,8 +82,8 @@
# attributions are listed in the accompanying credits file. # attributions are listed in the accompanying credits file.
# #
############################################################################## ##############################################################################
'''$Id: DT_Util.py,v 1.69 2000/07/05 15:52:55 shane Exp $''' '''$Id: DT_Util.py,v 1.70 2000/12/19 16:24:40 shane Exp $'''
__version__='$Revision: 1.69 $'[11:-2] __version__='$Revision: 1.70 $'[11:-2]
import regex, string, math, os import regex, string, math, os
from string import strip, join, atoi, lower, split, find from string import strip, join, atoi, lower, split, find
...@@ -267,18 +267,17 @@ def namespace(self, **kw): ...@@ -267,18 +267,17 @@ def namespace(self, **kw):
d['namespace']=namespace d['namespace']=namespace
def render(self, v, simple={ def render(self, v):
type(''): 1, type(0): 1, type(0.0): 1, "Render an object in the way done by the 'name' attribute"
type([]): 1, type(()): 1, if hasattr(v, '__render_with_namespace__'):
}.has_key): v = v.__render_with_namespace__(self)
"Render an object in the way done be the 'name' attribute" else:
vbase = getattr(v, 'aq_base', v)
if not simple(type(v)): if callable(vbase):
if hasattr(v,'isDocTemp') and v.isDocTemp: if getattr(vbase, 'isDocTemp', 0):
v=v(None, self) v = v(None, self)
else: else:
try: v=v() v = v()
except (AttributeError,TypeError): pass
return v return v
d['render']=render d['render']=render
......
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