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
9142fb81
Commit
9142fb81
authored
Jan 29, 2001
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the new setupLoop(name, expr) API that we're going to use in the
next version of the syntax.
parent
e3c29529
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
lib/python/TAL/DummyEngine.py
lib/python/TAL/DummyEngine.py
+22
-0
No files found.
lib/python/TAL/DummyEngine.py
View file @
9142fb81
...
...
@@ -166,3 +166,25 @@ class DummyEngine:
from
Products.ParsedXML.DOM
import
ExpatBuilder
doc
=
ExpatBuilder
.
parse
(
fileName
,
1
)
return
doc
,
macroName
[
i
+
1
:]
def
setupLoop
(
self
,
name
,
expr
):
seq
=
self
.
evaluateSequence
(
expr
)
return
Iterator
(
name
,
seq
,
self
)
class
Iterator
:
def
__init__
(
self
,
name
,
seq
,
engine
):
self
.
name
=
name
self
.
seq
=
seq
self
.
engine
=
engine
self
.
nextIndex
=
0
def
next
(
self
):
i
=
self
.
nextIndex
try
:
item
=
self
.
seq
[
i
]
except
IndexError
:
return
0
self
.
nextIndex
=
i
+
1
self
.
engine
.
setLocal
(
self
.
name
,
item
)
return
1
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