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
eed23e13
Commit
eed23e13
authored
Jul 22, 2003
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deny attributes being both part of tal:attributes
and having a messageid in i18n:attributes
parent
41b687a5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
0 deletions
+24
-0
lib/python/TAL/TALGenerator.py
lib/python/TAL/TALGenerator.py
+5
-0
lib/python/TAL/tests/input/test19.html
lib/python/TAL/tests/input/test19.html
+9
-0
lib/python/TAL/tests/input/test20.html
lib/python/TAL/tests/input/test20.html
+1
-0
lib/python/TAL/tests/output/test19.html
lib/python/TAL/tests/output/test19.html
+5
-0
lib/python/TAL/tests/output/test20.html
lib/python/TAL/tests/output/test20.html
+1
-0
lib/python/TAL/tests/test_htmltalparser.py
lib/python/TAL/tests/test_htmltalparser.py
+3
-0
No files found.
lib/python/TAL/TALGenerator.py
View file @
eed23e13
...
...
@@ -664,6 +664,11 @@ class TALGenerator:
# Convert repldict's name-->expr mapping to a
# name-->(compiled_expr, translate) mapping
for key, value in repldict.items():
if i18nattrs.get(key, None):
raise I18NError(
("
attribute
[
%
s
]
cannot
both
be
part
of
tal
:
attributes
" +
"
and
have
a
msgid
in
i18n
:
attributes
") % key,
position)
ce = self.compileExpression(value)
repldict[key] = ce, key in i18nattrs, i18nattrs.get(key)
for key in i18nattrs:
...
...
lib/python/TAL/tests/input/test19.html
0 → 100644
View file @
eed23e13
<input
name=
"Delete"
tal:attributes=
"name string:delete_button"
i18n:attributes=
"name"
>
<input
name=
"Delete"
i18n:attributes=
"name message-id"
>
<input
i18n:attributes=
" name message-id;
attr input-attr "
>
lib/python/TAL/tests/input/test20.html
0 → 100644
View file @
eed23e13
<input
name=
"Delete"
i18n:attributes=
"name"
>
lib/python/TAL/tests/output/test19.html
0 → 100644
View file @
eed23e13
<input
name=
"DELETE_BUTTON"
>
<input
name=
"MESSAGE-ID"
>
<input
name=
"MESSAGE-ID"
attr=
"INPUT-ATTR"
>
lib/python/TAL/tests/output/test20.html
0 → 100644
View file @
eed23e13
<input
name=
"DELETE"
>
lib/python/TAL/tests/test_htmltalparser.py
View file @
eed23e13
...
...
@@ -511,6 +511,9 @@ class TALGeneratorTestCases(TestCaseBase):
(
'bar'
,
None
,
'insert'
,
None
,
1
,
None
)])),
(
'endScope'
,
()),
])
self
.
_should_error
(
'''<input name="Delete"
tal:attributes="name string:delete_button"
i18n:attributes="name message-id">'''
)
def
test_i18n_name_bad_name
(
self
):
self
.
_should_error
(
"<span i18n:name='not a valid name' />"
)
...
...
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