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
0ccbb4fe
Commit
0ccbb4fe
authored
Nov 25, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test to expr documentation.
parent
a78afc17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
lib/python/DocumentTemplate/DT_Util.py
lib/python/DocumentTemplate/DT_Util.py
+14
-2
No files found.
lib/python/DocumentTemplate/DT_Util.py
View file @
0ccbb4fe
'''$Id: DT_Util.py,v 1.1
8 1997/11/25 15:20:30
jim Exp $'''
'''$Id: DT_Util.py,v 1.1
9 1997/11/25 15:26:34
jim Exp $'''
############################################################################
############################################################################
# Copyright
# Copyright
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
# (540) 371-6909
# (540) 371-6909
#
#
############################################################################
############################################################################
__version__
=
'$Revision: 1.1
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
9
$'
[
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
...
@@ -209,6 +209,15 @@ Python expression support
...
@@ -209,6 +209,15 @@ Python expression support
- The Python 'math' module.
- The Python 'math' module.
- A special function, 'test', that supports if-then expressions.
The 'test' function accepts any number of arguments. If the
first argument is true, then the second argument is returned,
otherwise if the third argument is true, then the fourth
argument is returned, and so on. If there is an odd number of
arguments, then the last argument is returned in the case that
none of the tested arguments is true, otherwise None is
returned.
For example, to convert a value to lower case::
For example, to convert a value to lower case::
<!--#var expr="_.string.lower(title)"-->
<!--#var expr="_.string.lower(title)"-->
...
@@ -290,6 +299,9 @@ except: from pDocumentTemplate import InstanceDict, TemplateDict, render_blocks
...
@@ -290,6 +299,9 @@ except: from pDocumentTemplate import InstanceDict, TemplateDict, render_blocks
############################################################################
############################################################################
# $Log: DT_Util.py,v $
# $Log: DT_Util.py,v $
# Revision 1.19 1997/11/25 15:26:34 jim
# Added test to expr documentation.
#
# Revision 1.18 1997/11/25 15:20:30 jim
# Revision 1.18 1997/11/25 15:20:30 jim
# Expanded test function to allow any number of arguments.
# Expanded test function to allow any number of arguments.
#
#
...
...
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