Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
712bc005
Commit
712bc005
authored
Oct 29, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "builtin" objects.
parent
e868c6a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
lib/python/DocumentTemplate/DT_Util.py
lib/python/DocumentTemplate/DT_Util.py
+21
-2
No files found.
lib/python/DocumentTemplate/DT_Util.py
View file @
712bc005
'''$Id: DT_Util.py,v 1.1
1 1997/10/29 21:03:26
jim Exp $'''
'''$Id: DT_Util.py,v 1.1
2 1997/10/29 21:30:24
jim Exp $'''
############################################################################
############################################################################
# Copyright
# Copyright
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
# (540) 371-6909
# (540) 371-6909
#
#
############################################################################
############################################################################
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
2
$'
[
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
...
@@ -119,6 +119,21 @@ def careful_getslice(seq, indexes, md):
...
@@ -119,6 +119,21 @@ def careful_getslice(seq, indexes, md):
return
v
return
v
import
new
,
string
,
math
expr_globals
=
new
.
module
(
'_'
)
d
=
expr_globals
.
__dict__
for
name
in
(
'None'
,
'abs'
,
'chr'
,
'divmod'
,
'float'
,
'hash'
,
'hex'
,
'int'
,
'len'
,
'max'
,
'min'
,
'oct'
,
'ord'
,
'pow'
,
'round'
,
'str'
):
d
[
name
]
=
__builtins__
[
name
]
d
[
'string'
]
=
string
d
[
'math'
]
=
math
def
test
(
cond
,
t
,
f
):
if
cond
:
return
t
return
f
d
[
'test'
]
=
test
def
name_param
(
params
,
tag
=
''
,
expr
=
0
):
def
name_param
(
params
,
tag
=
''
,
expr
=
0
):
used
=
params
.
has_key
used
=
params
.
has_key
if
used
(
''
):
if
used
(
''
):
...
@@ -136,6 +151,7 @@ def name_param(params,tag='',expr=0):
...
@@ -136,6 +151,7 @@ def name_param(params,tag='',expr=0):
elif
expr
and
used
(
'expr'
):
elif
expr
and
used
(
'expr'
):
name
=
params
[
'expr'
]
name
=
params
[
'expr'
]
expr
=
VSEval
.
Eval
(
name
,
expr
=
VSEval
.
Eval
(
name
,
globals
=
{
'__builtins__'
:{},
'_'
:
expr_globals
},
__mul__
=
VSEval
.
careful_mul
,
__mul__
=
VSEval
.
careful_mul
,
__getattr__
=
careful_getattr
,
__getattr__
=
careful_getattr
,
__getitem__
=
careful_getitem
,
__getitem__
=
careful_getitem
,
...
@@ -218,6 +234,9 @@ TemplateDict.pop.__roles__=TemplateDict.push.__roles__=()
...
@@ -218,6 +234,9 @@ TemplateDict.pop.__roles__=TemplateDict.push.__roles__=()
############################################################################
############################################################################
# $Log: DT_Util.py,v $
# $Log: DT_Util.py,v $
# Revision 1.12 1997/10/29 21:30:24 jim
# Added "builtin" objects.
#
# Revision 1.11 1997/10/29 21:03:26 jim
# Revision 1.11 1997/10/29 21:03:26 jim
# *** empty log message ***
# *** empty log message ***
#
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment