Skip to content

Commit

Permalink
Added namespace function to _ module for exprs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Mar 12, 1998
1 parent 438e610 commit 7cc70b0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions DT_Util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'''$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
Expand Down Expand Up @@ -52,7 +52,7 @@
# (540) 371-6909
#
############################################################################
__version__='$Revision: 1.25 $'[11:-2]
__version__='$Revision: 1.26 $'[11:-2]

import sys, regex, string, types, math, os
from string import rfind, strip, joinfields, atoi,lower,upper,capitalize
Expand Down Expand Up @@ -147,6 +147,16 @@ def _attr(inst, name, md={}):

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={
'__builtins__':{},
'_': expr_globals,
Expand Down Expand Up @@ -319,6 +329,9 @@ def parse_params(text,

############################################################################
# $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
# Added better handling of case like:
#
Expand Down

0 comments on commit 7cc70b0

Please sign in to comment.