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
a53e7d3f
Commit
a53e7d3f
authored
Oct 01, 2002
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Collector #539, and make DummyEngine work outside of Zope.
parent
c1624616
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
10 deletions
+33
-10
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/Products/PageTemplates/tests/input/StringExpression.html
.../Products/PageTemplates/tests/input/StringExpression.html
+6
-1
lib/python/Products/PageTemplates/tests/output/StringExpression.html
...Products/PageTemplates/tests/output/StringExpression.html
+4
-1
lib/python/TAL/DummyEngine.py
lib/python/TAL/DummyEngine.py
+10
-5
lib/python/TAL/TALGenerator.py
lib/python/TAL/TALGenerator.py
+10
-3
No files found.
doc/CHANGES.txt
View file @
a53e7d3f
...
...
@@ -6,6 +6,9 @@ Zope Changes
Bugs Fixed
- Collector #539: Fixed rendering of TAL namespace tags with an
'on-error' statement.
- Collector #586: Generated 'start' scripts had a nonsensical
export of an "INST_HOME" environment variable.
...
...
lib/python/Products/PageTemplates/tests/input/StringExpression.html
View file @
a53e7d3f
<html>
<body>
<head>
<title
tal:content=
"string:Hello World!"
>
This is the title
</title>
</head>
<body>
<tal:block
on-error=
"string:Error:${error/value}"
replace=
"x"
/>
<tal:block
on-error=
"string:Error:${error/value}"
>
<p
tal:content=
"x"
>
p
</p>
</tal:block>
<div
tal:replace=
"structure string:<hr />"
>
rule
</div>
</body>
</html>
lib/python/Products/PageTemplates/tests/output/StringExpression.html
View file @
a53e7d3f
<html>
<body>
<head>
<title>
Hello World!
</title>
</head>
<body>
Error:x
Error:x
<hr
/>
</body>
</html>
lib/python/TAL/DummyEngine.py
View file @
a53e7d3f
...
...
@@ -21,11 +21,16 @@ import sys
from
TALDefs
import
NAME_RE
,
TALESError
,
ErrorInfo
from
ITALES
import
ITALESCompiler
,
ITALESEngine
from
DocumentTemplate.DT_Util
import
ustr
try
:
from
Zope.I18n.ITranslationService
import
ITranslationService
from
Zope.I18n.IDomain
import
IDomain
except
ImportError
:
# Before 2.7
IDomain
=
None
if
sys
.
modules
.
has_key
(
'Zope'
):
try
:
from
Zope.I18n.ITranslationService
import
ITranslationService
from
Zope.I18n.IDomain
import
IDomain
except
ImportError
:
pass
if
IDomain
is
None
:
# Before 2.7, or not in Zope
class
ITranslationService
:
pass
class
IDomain
:
pass
...
...
lib/python/TAL/TALGenerator.py
View file @
a53e7d3f
...
...
@@ -275,7 +275,7 @@ class TALGenerator:
else:
self.emit("
setGlobal
", name, cexpr)
def emitOnError(self, name, onError):
def emitOnError(self, name, onError
, TALtag, isend
):
block = self.popProgram()
key, expr = parseSubstitution(onError)
cexpr = self.compileExpression(expr)
...
...
@@ -284,7 +284,10 @@ class TALGenerator:
else:
assert key == "
structure
"
self.emit("
insertStructure
", cexpr, {}, [])
self.emitEndTag(name)
if TALtag:
self.emitOptTag(name, (None, 1), isend)
else:
self.emitEndTag(name)
handler = self.popProgram()
self.emit("
onError
", block, handler)
...
...
@@ -599,7 +602,11 @@ class TALGenerator:
todo["
scope
"] = 1
if onError:
self.pushProgram() # handler
if TALtag:
self.pushProgram() # start
self.emitStartTag(name, list(attrlist)) # Must copy attrlist!
if TALtag:
self.pushProgram() # start
self.pushProgram() # block
todo["
onError
"] = onError
if define:
...
...
@@ -758,7 +765,7 @@ class TALGenerator:
if condition:
self.emitCondition(condition)
if onError:
self.emitOnError(name, onError)
self.emitOnError(name, onError
, optTag and optTag[1], isend
)
if scope:
self.emit("
endScope
")
if i18ncontext:
...
...
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