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