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
3aa2fe25
Commit
3aa2fe25
authored
Oct 02, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged Hotfix_2001-09-28
parent
fe08653e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
lib/python/DocumentTemplate/DT_Var.py
lib/python/DocumentTemplate/DT_Var.py
+8
-4
No files found.
lib/python/DocumentTemplate/DT_Var.py
View file @
3aa2fe25
...
...
@@ -217,8 +217,8 @@ Evaluating expressions without rendering results
'''
# '
__rcs_id__
=
'$Id: DT_Var.py,v 1.4
3 2001/09/25 13:37:02 andreasjung
Exp $'
__version__
=
'$Revision: 1.4
3
$'
[
11
:
-
2
]
__rcs_id__
=
'$Id: DT_Var.py,v 1.4
4 2001/10/02 14:23:32 shane
Exp $'
__version__
=
'$Revision: 1.4
4
$'
[
11
:
-
2
]
from
DT_Util
import
parse_params
,
name_param
,
str
import
re
,
string
,
sys
...
...
@@ -288,11 +288,15 @@ class Var:
# handle special formats defined using fmt= first
if
have_arg
(
'fmt'
):
_get
=
getattr
(
md
,
'guarded_getattr'
,
None
)
if
_get
is
None
:
_get
=
getattr
fmt
=
args
[
'fmt'
]
if
have_arg
(
'null'
)
and
not
val
and
val
!=
0
:
try
:
if
hasattr
(
val
,
fmt
):
val
=
getattr
(
val
,
fmt
)()
val
=
_get
(
val
,
fmt
)()
elif
special_formats
.
has_key
(
fmt
):
val
=
special_formats
[
fmt
](
val
,
name
,
md
)
elif
fmt
==
''
:
val
=
''
...
...
@@ -307,7 +311,7 @@ class Var:
# We duplicate the code here to avoid exception handler
# which tends to screw up stack or leak
if
hasattr
(
val
,
fmt
):
val
=
getattr
(
val
,
fmt
)()
val
=
_get
(
val
,
fmt
)()
elif
special_formats
.
has_key
(
fmt
):
val
=
special_formats
[
fmt
](
val
,
name
,
md
)
elif
fmt
==
''
:
val
=
''
...
...
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