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
e696ec1a
Commit
e696ec1a
authored
Oct 09, 2002
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Collector #372
parent
eaa213c1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
11 deletions
+22
-11
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/Products/PageTemplates/PythonExpr.py
lib/python/Products/PageTemplates/PythonExpr.py
+3
-3
lib/python/Products/PageTemplates/TALES.py
lib/python/Products/PageTemplates/TALES.py
+9
-6
lib/python/TAL/DummyEngine.py
lib/python/TAL/DummyEngine.py
+3
-0
lib/python/TAL/ITALES.py
lib/python/TAL/ITALES.py
+3
-0
lib/python/TAL/TALInterpreter.py
lib/python/TAL/TALInterpreter.py
+2
-2
No files found.
doc/CHANGES.txt
View file @
e696ec1a
...
...
@@ -28,6 +28,8 @@ Zope Changes
Bugs Fixed
- Collector #372: tal:attributes failed when combined with tal:replace.
- Don't try to close network connections in the signal handler
for shutdown. This hosed ZEO clients.
...
...
lib/python/Products/PageTemplates/PythonExpr.py
View file @
e696ec1a
...
...
@@ -14,7 +14,7 @@
"""Generic Python Expression Handler
"""
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
from
TALES
import
CompilerError
from
sys
import
exc_info
...
...
@@ -47,7 +47,7 @@ class PythonExpr:
# Bind template variables
names
=
{}
vars
=
econtext
.
vars
getType
=
econtext
.
_engine
.
getTypes
().
get
getType
=
econtext
.
getCompiler
()
.
getTypes
().
get
for
vname
in
self
.
_f_varnames
:
val
=
vars
.
get
(
vname
,
_marker
)
if
val
is
_marker
:
...
...
@@ -78,5 +78,5 @@ class ExprTypeProxy:
self
.
_econtext
=
econtext
def
__call__
(
self
,
text
):
return
self
.
_handler
(
self
.
_name
,
text
,
self
.
_econtext
.
_engine
)(
self
.
_econtext
)
self
.
_econtext
.
getCompiler
()
)(
self
.
_econtext
)
lib/python/Products/PageTemplates/TALES.py
View file @
e696ec1a
...
...
@@ -15,7 +15,7 @@
An implementation of a generic TALES engine
"""
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
6
$'
[
11
:
-
2
]
import
re
,
sys
,
ZTUtils
from
MultiMapping
import
MultiMapping
...
...
@@ -152,8 +152,8 @@ class Context:
position
=
(
None
,
None
)
source_file
=
None
def
__init__
(
self
,
engine
,
contexts
):
self
.
_
engine
=
engine
def
__init__
(
self
,
compiler
,
contexts
):
self
.
_
compiler
=
compiler
self
.
contexts
=
contexts
contexts
[
'nothing'
]
=
None
contexts
[
'default'
]
=
Default
...
...
@@ -170,6 +170,9 @@ class Context:
# Keep track of what needs to be popped as each scope ends.
self
.
_scope_stack
=
[]
def
getCompiler
(
self
):
return
self
.
_compiler
def
beginScope
(
self
):
self
.
_scope_stack
.
append
([
self
.
local_vars
.
copy
()])
...
...
@@ -198,8 +201,8 @@ class Context:
def
setRepeat
(
self
,
name
,
expr
):
expr
=
self
.
evaluate
(
expr
)
if
not
expr
:
return
self
.
_
engine
.
Iterator
(
name
,
(),
self
)
it
=
self
.
_
engine
.
Iterator
(
name
,
expr
,
self
)
return
self
.
_
compiler
.
Iterator
(
name
,
(),
self
)
it
=
self
.
_
compiler
.
Iterator
(
name
,
expr
,
self
)
old_value
=
self
.
repeat_vars
.
get
(
name
)
self
.
_scope_stack
[
-
1
].
append
((
name
,
old_value
))
self
.
repeat_vars
[
name
]
=
it
...
...
@@ -208,7 +211,7 @@ class Context:
def
evaluate
(
self
,
expression
,
isinstance
=
isinstance
,
StringType
=
StringType
):
if
isinstance
(
expression
,
StringType
):
expression
=
self
.
_
engine
.
compile
(
expression
)
expression
=
self
.
_
compiler
.
compile
(
expression
)
__traceback_supplement__
=
(
TALESTracebackSupplement
,
self
,
expression
)
return
expression
(
self
)
...
...
lib/python/TAL/DummyEngine.py
View file @
e696ec1a
...
...
@@ -62,6 +62,9 @@ class DummyEngine:
def getCompilerError(self):
return CompilerError
def getCompiler(self):
return self
def setSourceFile(self, source_file):
self.source_file = source_file
...
...
lib/python/TAL/ITALES.py
View file @
e696ec1a
...
...
@@ -41,6 +41,9 @@ class ITALESEngine(Interface):
ITALESCompiler.compile().
"""
def
getCompiler
():
"""Return an object that supports ITALESCompiler."""
def
getDefault
():
"""Return the value of the 'default' TALES expression.
...
...
lib/python/TAL/TALInterpreter.py
View file @
e696ec1a
...
...
@@ -594,7 +594,7 @@ class TALInterpreter:
def
insertHTMLStructure
(
self
,
text
,
repldict
):
from
HTMLTALParser
import
HTMLTALParser
gen
=
AltTALGenerator
(
repldict
,
self
.
engine
,
0
)
gen
=
AltTALGenerator
(
repldict
,
self
.
engine
.
getCompiler
()
,
0
)
p
=
HTMLTALParser
(
gen
)
# Raises an exception if text is invalid
p
.
parseString
(
text
)
program
,
macros
=
p
.
getCode
()
...
...
@@ -602,7 +602,7 @@ class TALInterpreter:
def
insertXMLStructure
(
self
,
text
,
repldict
):
from
TALParser
import
TALParser
gen
=
AltTALGenerator
(
repldict
,
self
.
engine
,
0
)
gen
=
AltTALGenerator
(
repldict
,
self
.
engine
.
getCompiler
()
,
0
)
p
=
TALParser
(
gen
)
gen
.
enable
(
0
)
p
.
parseFragment
(
'<!DOCTYPE foo PUBLIC "foo" "bar"><foo>'
)
...
...
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