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
445409d5
Commit
445409d5
authored
Aug 08, 2003
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge from gotcha-talz3_backport-branch
parent
860436c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
26 deletions
+11
-26
lib/python/TAL/TALInterpreter.py
lib/python/TAL/TALInterpreter.py
+11
-26
No files found.
lib/python/TAL/TALInterpreter.py
View file @
445409d5
...
...
@@ -180,18 +180,7 @@ class TALInterpreter:
self
.
macroStack
.
append
([
macroName
,
slots
,
entering
,
self
.
i18nContext
])
def
popMacro
(
self
):
stuff
=
self
.
macroStack
.
pop
()
self
.
i18nContext
=
stuff
[
3
]
return
stuff
def
macroContext
(
self
,
what
):
macroStack
=
self
.
macroStack
i
=
len
(
macroStack
)
while
i
>
0
:
i
=
i
-
1
if
macroStack
[
i
][
0
]
==
what
:
return
i
return
-
1
return
self
.
macroStack
.
pop
()
def
__call__
(
self
):
assert
self
.
level
==
0
...
...
@@ -291,6 +280,12 @@ class TALInterpreter:
for
item
in
attrList
:
if
_len
(
item
)
==
2
:
name
,
s
=
item
else
:
# item[2] is the 'action' field:
if
item
[
2
]
in
(
'metal'
,
'tal'
,
'xmlns'
,
'i18n'
):
if
not
self
.
showtal
:
continue
ok
,
name
,
s
=
self
.
attrAction
(
item
)
else
:
ok
,
name
,
s
=
attrAction
(
self
,
item
)
if
not
ok
:
...
...
@@ -299,7 +294,8 @@ class TALInterpreter:
if
(
wrap
and
col
>=
align
and
col
+
1
+
slen
>
wrap
):
append
(
"
\
n
"
+
" "
*
align
)
append
(
"
\
n
"
)
append
(
" "
*
align
)
col
=
align
+
slen
else
:
append
(
" "
)
...
...
@@ -314,8 +310,7 @@ class TALInterpreter:
def
attrAction
(
self
,
item
):
name
,
value
,
action
=
item
[:
3
]
if
action
==
'insert'
or
(
action
in
(
'metal'
,
'tal'
,
'xmlns'
,
'i18n'
)
and
not
self
.
showtal
):
if
action
==
'insert'
:
return
0
,
name
,
value
macs
=
self
.
macroStack
if
action
==
'metal'
and
self
.
metal
and
macs
:
...
...
@@ -345,8 +340,6 @@ class TALInterpreter:
return
1
,
name
,
value
def
attrAction_tal
(
self
,
item
):
if
item
[
2
]
in
(
'metal'
,
'tal'
,
'xmlns'
,
'i18n'
):
return
self
.
attrAction
(
item
)
name
,
value
,
action
=
item
[:
3
]
ok
=
1
expr
,
xlat
,
msgid
=
item
[
3
:]
...
...
@@ -409,14 +402,6 @@ class TALInterpreter:
self
.
do_optTag
(
stuff
)
bytecode_handlers
[
"optTag"
]
=
do_optTag
def
dumpMacroStack
(
self
,
prefix
,
suffix
,
value
):
sys
.
stderr
.
write
(
"+---- %s%s = %s
\
n
"
%
(
prefix
,
suffix
,
value
))
for
i
in
range
(
len
(
self
.
macroStack
)):
what
,
macroName
,
slots
=
self
.
macroStack
[
i
][:
3
]
sys
.
stderr
.
write
(
"| %2d. %-12s %-12s %s
\
n
"
%
(
i
,
what
,
macroName
,
slots
and
slots
.
keys
()))
sys
.
stderr
.
write
(
"+--------------------------------------
\
n
"
)
def
do_rawtextBeginScope
(
self
,
(
s
,
col
,
position
,
closeprev
,
dict
)):
self
.
_stream_write
(
s
)
self
.
col
=
col
...
...
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