Commit 10891849 authored by Shane Hathaway's avatar Shane Hathaway

Corrections to these two files permit usage of pDocumentTemplate again.

parent 47d964fc
......@@ -84,8 +84,8 @@
##############################################################################
__doc__='''Collect rules for access to objects that don\'t have roles.
$Id: SimpleObjectPolicies.py,v 1.3 2000/05/26 21:39:27 shane Exp $'''
__version__='$Revision: 1.3 $'[11:-2]
$Id: SimpleObjectPolicies.py,v 1.4 2000/05/26 22:06:08 shane Exp $'''
__version__='$Revision: 1.4 $'[11:-2]
import Record
......@@ -102,9 +102,11 @@ from DocumentTemplate.DT_Util import TemplateDict
# Temporarily create a DictInstance so that we can mark its type as
# being a key in the ContainerAssertions.
templateDict = TemplateDict()
dictInstance = templateDict(dummy=1)
ContainerAssertions[type(dictInstance)]=1
try:
dictInstance = templateDict(dummy=1)
ContainerAssertions[type(dictInstance)]=1
except:
# We're probably using pDocumentTemplate.
pass
Containers=ContainerAssertions.get
......@@ -82,8 +82,8 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
'''$Id: DT_Util.py,v 1.64 2000/05/26 21:37:48 shane Exp $'''
__version__='$Revision: 1.64 $'[11:-2]
'''$Id: DT_Util.py,v 1.65 2000/05/26 22:06:08 shane Exp $'''
__version__='$Revision: 1.65 $'[11:-2]
import regex, string, math, os
from string import strip, join, atoi, lower, split, find
......@@ -258,13 +258,12 @@ class namespace_:
def namespace(self, **kw):
"""Create a tuple consisting of a single instance whos attributes are
provided as keyword arguments."""
if callable(self):
# Use the default implementation (usually from cDocumentTemplate.)
return self(kw)
r=namespace_()
d=r.__dict__
for k, v in kw.items(): d[k]=v
return r,
try: return self(kw) # Try to use the cDocumentTemplate implementation.
except AttributeError:
r=namespace_()
d=r.__dict__
for k, v in kw.items(): d[k]=v
return r,
d['namespace']=namespace
......
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