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
a2d2befc
Commit
a2d2befc
authored
Dec 16, 2002
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Collector #451 and #468
parent
8f99162b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
3 deletions
+19
-3
lib/python/TAL/TALDefs.py
lib/python/TAL/TALDefs.py
+3
-1
lib/python/TAL/TALGenerator.py
lib/python/TAL/TALGenerator.py
+2
-1
lib/python/TAL/TALParser.py
lib/python/TAL/TALParser.py
+1
-1
lib/python/TAL/tests/input/test16.xml
lib/python/TAL/tests/input/test16.xml
+7
-0
lib/python/TAL/tests/output/test16.xml
lib/python/TAL/tests/output/test16.xml
+6
-0
No files found.
lib/python/TAL/TALDefs.py
View file @
a2d2befc
...
...
@@ -113,13 +113,15 @@ _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
def parseAttributeReplacements(arg):
def parseAttributeReplacements(arg
, xml
):
dict = {}
for part in splitParts(arg):
m = _attr_re.match(part)
if not m:
raise TALError("
Bad
syntax
in
attributes
:
" + `part`)
name, expr = m.group(1, 2)
if xml:
name = name.lower()
if dict.has_key(name):
raise TALError("
Duplicate
attribute
name
in
attributes
:
" + `part`)
dict[name] = expr
...
...
lib/python/TAL/TALGenerator.py
View file @
a2d2befc
...
...
@@ -646,7 +646,8 @@ class TALGenerator:
self.pushProgram()
if attrsubst or i18nattrs:
if attrsubst:
repldict = TALDefs.parseAttributeReplacements(attrsubst)
repldict = TALDefs.parseAttributeReplacements(attrsubst,
self.xml)
else:
repldict = {}
if i18nattrs:
...
...
lib/python/TAL/TALParser.py
View file @
a2d2befc
...
...
@@ -72,7 +72,7 @@ class TALParser(XMLParser):
for
key
,
value
in
attrlist
:
key
,
keybase
,
keyns
=
self
.
fixname
(
key
)
ns
=
keyns
or
namens
# default to tag namespace
item
=
key
,
value
item
=
key
.
lower
()
,
value
if
ns
==
'metal'
:
metaldict
[
keybase
]
=
value
item
=
item
+
(
"metal"
,)
...
...
lib/python/TAL/tests/input/test16.xml
0 → 100644
View file @
a2d2befc
<?xml version="1.0"?>
<body
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
>
<img
href=
"foo"
Alt=
"bar"
tal:attributes=
"Href string:about:foo;alT string:baz"
/>
</body>
lib/python/TAL/tests/output/test16.xml
0 → 100644
View file @
a2d2befc
<?xml version="1.0"?>
<body>
<img
href=
"about:foo"
alt=
"baz"
/>
</body>
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