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