Commit f28346fc authored by Jim Fulton's avatar Jim Fulton

Added namespace function to _ module for exprs.

parent 9185789d
'''$Id: DT_Util.py,v 1.25 1998/03/10 15:04:58 jim Exp $''' '''$Id: DT_Util.py,v 1.26 1998/03/12 20:52:11 jim Exp $'''
############################################################################ ############################################################################
# Copyright # Copyright
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
# (540) 371-6909 # (540) 371-6909
# #
############################################################################ ############################################################################
__version__='$Revision: 1.25 $'[11:-2] __version__='$Revision: 1.26 $'[11:-2]
import sys, regex, string, types, math, os import sys, regex, string, types, math, os
from string import rfind, strip, joinfields, atoi,lower,upper,capitalize from string import rfind, strip, joinfields, atoi,lower,upper,capitalize
...@@ -147,6 +147,16 @@ def _attr(inst, name, md={}): ...@@ -147,6 +147,16 @@ def _attr(inst, name, md={}):
d['attr']=_attr d['attr']=_attr
class namespace_: pass
def namespace(**kw):
r=namespace_()
d=r.__dict__
for k, v in kw.items(): d[k]=v
return r,
d['namespace']=namespace
expr_globals={ expr_globals={
'__builtins__':{}, '__builtins__':{},
'_': expr_globals, '_': expr_globals,
...@@ -319,6 +329,9 @@ except: from pDocumentTemplate import InstanceDict, TemplateDict, render_blocks ...@@ -319,6 +329,9 @@ except: from pDocumentTemplate import InstanceDict, TemplateDict, render_blocks
############################################################################ ############################################################################
# $Log: DT_Util.py,v $ # $Log: DT_Util.py,v $
# Revision 1.26 1998/03/12 20:52:11 jim
# Added namespace function to _ module for exprs.
#
# Revision 1.25 1998/03/10 15:04:58 jim # Revision 1.25 1998/03/10 15:04:58 jim
# Added better handling of case like: # Added better handling of case like:
# #
......
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