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
82841082
Commit
82841082
authored
May 15, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change CancelAction to Default and eliminate inserted attribute turds.
parent
e13dcef9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
lib/python/TAL/DummyEngine.py
lib/python/TAL/DummyEngine.py
+4
-6
lib/python/TAL/TALInterpreter.py
lib/python/TAL/TALInterpreter.py
+8
-6
No files found.
lib/python/TAL/DummyEngine.py
View file @
82841082
...
@@ -92,7 +92,7 @@ import string
...
@@ -92,7 +92,7 @@ import string
from
TALDefs
import
NAME_RE
,
TALError
,
TALESError
from
TALDefs
import
NAME_RE
,
TALError
,
TALESError
CancelAction
=
[]
Default
=
[]
class
DummyEngine
:
class
DummyEngine
:
...
@@ -122,12 +122,10 @@ class DummyEngine:
...
@@ -122,12 +122,10 @@ class DummyEngine:
if
self
.
locals
is
self
.
stack
[
-
1
]:
if
self
.
locals
is
self
.
stack
[
-
1
]:
# Unmerge this scope's locals from previous scope of first set
# Unmerge this scope's locals from previous scope of first set
self
.
locals
=
self
.
locals
.
copy
()
self
.
locals
=
self
.
locals
.
copy
()
if
value
is
not
CancelAction
:
self
.
locals
[
name
]
=
value
self
.
locals
[
name
]
=
value
def
setGlobal
(
self
,
name
,
value
):
def
setGlobal
(
self
,
name
,
value
):
if
value
is
not
CancelAction
:
self
.
globals
[
name
]
=
value
self
.
globals
[
name
]
=
value
def
evaluate
(
self
,
expression
):
def
evaluate
(
self
,
expression
):
expression
=
self
.
uncompile
(
expression
)
expression
=
self
.
uncompile
(
expression
)
...
@@ -225,8 +223,8 @@ class DummyEngine:
...
@@ -225,8 +223,8 @@ class DummyEngine:
def getTALESError(self):
def getTALESError(self):
return TALESError
return TALESError
def get
CancelAction
(self):
def get
Default
(self):
return
CancelAction
return
Default
class Iterator:
class Iterator:
...
...
lib/python/TAL/TALInterpreter.py
View file @
82841082
...
@@ -157,7 +157,7 @@ class TALInterpreter:
...
@@ -157,7 +157,7 @@ class TALInterpreter:
self
.
macros
=
macros
self
.
macros
=
macros
self
.
engine
=
engine
self
.
engine
=
engine
self
.
TALESError
=
engine
.
getTALESError
()
self
.
TALESError
=
engine
.
getTALESError
()
self
.
CancelAction
=
engine
.
getCancelAction
()
self
.
Default
=
engine
.
getDefault
()
self
.
stream
=
stream
or
sys
.
stdout
self
.
stream
=
stream
or
sys
.
stdout
self
.
debug
=
debug
self
.
debug
=
debug
self
.
wrap
=
wrap
self
.
wrap
=
wrap
...
@@ -265,7 +265,7 @@ class TALInterpreter:
...
@@ -265,7 +265,7 @@ class TALInterpreter:
if
action
<=
1
and
self
.
tal
:
if
action
<=
1
and
self
.
tal
:
if
self
.
html
and
string
.
lower
(
name
)
in
BOOLEAN_HTML_ATTRS
:
if
self
.
html
and
string
.
lower
(
name
)
in
BOOLEAN_HTML_ATTRS
:
evalue
=
self
.
engine
.
evaluateBoolean
(
item
[
3
])
evalue
=
self
.
engine
.
evaluateBoolean
(
item
[
3
])
if
evalue
is
self
.
CancelAction
:
if
evalue
is
self
.
Default
:
if
action
==
1
:
# Cancelled insert
if
action
==
1
:
# Cancelled insert
continue
continue
elif
not
evalue
:
elif
not
evalue
:
...
@@ -274,7 +274,7 @@ class TALInterpreter:
...
@@ -274,7 +274,7 @@ class TALInterpreter:
value
=
None
value
=
None
else
:
else
:
evalue
=
self
.
engine
.
evaluateText
(
item
[
3
])
evalue
=
self
.
engine
.
evaluateText
(
item
[
3
])
if
evalue
is
self
.
CancelAction
:
if
evalue
is
self
.
Default
:
if
action
==
1
:
# Cancelled insert
if
action
==
1
:
# Cancelled insert
continue
continue
else
:
else
:
...
@@ -285,6 +285,8 @@ class TALInterpreter:
...
@@ -285,6 +285,8 @@ class TALInterpreter:
name
[
-
13
:]
==
":define-macro"
and
self
.
metal
):
name
[
-
13
:]
==
":define-macro"
and
self
.
metal
):
name
=
name
[:
-
13
]
+
":use-macro"
name
=
name
[:
-
13
]
+
":use-macro"
value
=
self
.
currentMacro
value
=
self
.
currentMacro
elif
action
==
1
:
continue
# Unexecuted insert
if
value
is
None
:
if
value
is
None
:
s
=
name
s
=
name
else
:
else
:
...
@@ -327,7 +329,7 @@ class TALInterpreter:
...
@@ -327,7 +329,7 @@ class TALInterpreter:
text
=
self
.
engine
.
evaluateText
(
expr
)
text
=
self
.
engine
.
evaluateText
(
expr
)
if
text
is
None
:
if
text
is
None
:
return
return
if
text
is
self
.
CancelAction
:
if
text
is
self
.
Default
:
self
.
interpret
(
block
)
self
.
interpret
(
block
)
return
return
text
=
cgi
.
escape
(
text
)
text
=
cgi
.
escape
(
text
)
...
@@ -340,7 +342,7 @@ class TALInterpreter:
...
@@ -340,7 +342,7 @@ class TALInterpreter:
structure
=
self
.
engine
.
evaluateStructure
(
expr
)
structure
=
self
.
engine
.
evaluateStructure
(
expr
)
if
structure
is
None
:
if
structure
is
None
:
return
return
if
structure
is
self
.
CancelAction
:
if
structure
is
self
.
Default
:
self
.
interpret
(
block
)
self
.
interpret
(
block
)
return
return
text
=
str
(
structure
)
text
=
str
(
structure
)
...
@@ -397,7 +399,7 @@ class TALInterpreter:
...
@@ -397,7 +399,7 @@ class TALInterpreter:
self
.
interpret
(
block
)
self
.
interpret
(
block
)
return
return
macro
=
self
.
engine
.
evaluateMacro
(
macroExpr
)
macro
=
self
.
engine
.
evaluateMacro
(
macroExpr
)
if
macro
is
self
.
CancelAction
:
if
macro
is
self
.
Default
:
self
.
interpret
(
block
)
self
.
interpret
(
block
)
return
return
if
not
isCurrentVersion
(
macro
):
if
not
isCurrentVersion
(
macro
):
...
...
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