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
f2d507de
Commit
f2d507de
authored
Aug 05, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved handling of expr syntax errors. Could be better, but code
is dependent on Python version.
parent
648cc7d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
lib/python/DocumentTemplate/DT_Util.py
lib/python/DocumentTemplate/DT_Util.py
+13
-3
No files found.
lib/python/DocumentTemplate/DT_Util.py
View file @
f2d507de
'''$Id: DT_Util.py,v 1.
39 1998/07/29 15:35
:27 jim Exp $'''
'''$Id: DT_Util.py,v 1.
40 1998/08/05 18:26
:27 jim Exp $'''
############################################################################
# Copyright
...
...
@@ -52,7 +52,7 @@
# (540) 371-6909
#
############################################################################
__version__
=
'$Revision: 1.
39
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
40
$'
[
11
:
-
2
]
import
sys
,
regex
,
string
,
types
,
math
,
os
from
string
import
rfind
,
strip
,
joinfields
,
atoi
,
lower
,
upper
,
capitalize
...
...
@@ -232,7 +232,13 @@ def name_param(params,tag='',expr=0, attr='name', default_unnamed=1):
if
used
(
'expr'
):
raise
ParseError
,
(
'two exprs given'
,
tag
)
v
=
v
[
1
:
-
1
]
expr
=
Eval
(
v
,
expr_globals
)
try
:
expr
=
Eval
(
v
,
expr_globals
)
except
SyntaxError
,
v
:
m
,(
huh
,
l
,
c
,
src
)
=
v
raise
ParseError
,
(
'<strong>Expression (Python) Syntax error</strong>:'
'
\
n
<pre>
\
n
%s
\
n
</pre>
\
n
'
%
v
[
0
],
tag
)
return
v
,
expr
else
:
raise
ParseError
,
(
'The "..." shorthand for expr was used in a tag that doesn
\
'
t support expr attributes.'
,
...
...
@@ -406,6 +412,10 @@ def parse_params(text,
############################################################################
# $Log: DT_Util.py,v $
# Revision 1.40 1998/08/05 18:26:27 jim
# Improved handling of expr syntax errors. Could be better, but code
# is dependent on Python version.
#
# Revision 1.39 1998/07/29 15:35:27 jim
# Fixed bug in handling "..." shorthand.
#
...
...
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