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
f7880ca5
Commit
f7880ca5
authored
Jan 30, 2001
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- In insertText(), if the expression yields None, insert nothing.
- Added (untested) insertStructure().
parent
95557af5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
lib/python/TAL/TALInterpreter.py
lib/python/TAL/TALInterpreter.py
+15
-1
No files found.
lib/python/TAL/TALInterpreter.py
View file @
f7880ca5
...
...
@@ -156,7 +156,21 @@ class TALInterpreter:
def
do_insertText
(
self
,
expr
):
text
=
self
.
engine
.
evaluateText
(
expr
)
self
.
stream
.
write
(
str
(
text
))
if
text
is
None
:
return
self
.
stream
.
write
(
text
)
def
do_insertStructure
(
self
,
expr
):
structure
=
self
.
engine
.
evaluateStructure
(
expr
)
if
structure
is
None
:
return
program
,
macros
=
TALCompiler
(
structure
)()
saveMacros
=
self
.
macros
if
macros
:
self
.
macros
=
saveMacros
.
copy
()
self
.
macros
.
update
(
macros
)
self
.
interpret
(
program
)
self
.
macros
=
saveMacros
def
do_loop
(
self
,
name
,
expr
,
block
):
iterator
=
self
.
engine
.
setupLoop
(
name
,
expr
)
...
...
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