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
dc01d2e4
Commit
dc01d2e4
authored
Jul 02, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made tal:attribute parser more strict, and replaces "print" statements with raised exceptions.
parent
57cfe411
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
lib/python/TAL/CHANGES.txt
lib/python/TAL/CHANGES.txt
+3
-0
lib/python/TAL/TALDefs.py
lib/python/TAL/TALDefs.py
+3
-5
No files found.
lib/python/TAL/CHANGES.txt
View file @
dc01d2e4
...
...
@@ -12,3 +12,6 @@ TAL changes
- tal:atributes was creating stray attributes in METAL
expansion, and there was no unit test for this behavior.
- tal:attributes parsing was not catching badly malformed
values, and used "print" instead of raising exceptions.
lib/python/TAL/TALDefs.py
View file @
dc01d2e4
...
...
@@ -153,7 +153,7 @@ class TALESError(TALError):
self
.
info
=
info
import
re
_attr_re
=
re
.
compile
(
r"\
s*([^
\s]+)\
s
*(
.*)
\Z"
,
re
.
S
)
_attr_re
=
re
.
compile
(
r"\
s*([^
\s]+)\
s
+([^
\s]
.*)\
Z
", re.S)
_subst_re = re.compile(r"
\
s
*
(
?
:(
text
|
structure
)
\
s
+
)
?
(.
*
)
\
Z
", re.S)
del re
...
...
@@ -162,12 +162,10 @@ def parseAttributeReplacements(arg):
for part in splitParts(arg):
m = _attr_re.match(part)
if not m:
print
"Bad syntax in attributes:"
,
`part`
continue
raise TALError("
Bad
syntax
in
attributes
:
" + `part`)
name, expr = m.group(1, 2)
if dict.has_key(name):
print
"Duplicate attribute name in attributes:"
,
`part`
continue
raise TALError("
Duplicate
attribute
name
in
attributes
:
" + `part`)
dict[name] = expr
return dict
...
...
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