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
18641731
Commit
18641731
authored
Oct 22, 2001
by
matt@zope.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup callbacks somewhat
parent
73bfe884
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
lib/python/Products/Transience/Transience.py
lib/python/Products/Transience/Transience.py
+21
-9
No files found.
lib/python/Products/Transience/Transience.py
View file @
18641731
...
...
@@ -85,10 +85,10 @@
"""
Core session tracking SessionData class.
$Id: Transience.py,v 1.
3 2001/10/22 18:48:17
matt Exp $
$Id: Transience.py,v 1.
4 2001/10/22 20:00:34
matt Exp $
"""
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
import
Globals
from
Globals
import
HTMLFile
,
MessageDialog
...
...
@@ -229,8 +229,6 @@ class TransientObjectContainer(SimpleItem):
self
[
key
]
=
item
self
.
notifyAdd
(
item
)
return
item
...
...
@@ -283,15 +281,27 @@ class TransientObjectContainer(SimpleItem):
self
.
_delCallback
=
f
def
notifyAdd
(
self
,
item
):
if
self
.
_addCallback
:
callback
=
self
.
_addCallback
if
type
(
callback
)
is
type
(
''
):
callback
=
self
.
aq_parent
.
unrestrictedTraverse
(
callback
)
if
callable
(
callback
):
try
:
self
.
_addCallback
(
item
,
self
)
# Use self as context
callback
(
item
,
self
)
# Use self as context
except
:
pass
# Eat all errors
def
notifyDestruct
(
self
,
item
):
if
self
.
_delCallback
:
callback
=
self
.
_delCallback
if
type
(
callback
)
is
type
(
''
):
callback
=
self
.
aq_parent
.
unrestrictedTraverse
(
callback
)
if
callable
(
callback
):
try
:
self
.
_delCallback
(
item
,
self
)
# Use self as context
callback
(
item
,
self
)
# Use self as context
except
:
pass
# Eat all errors
# -----------------------------------------------------------------
...
...
@@ -423,11 +433,12 @@ class TransientObjectContainer(SimpleItem):
# if d != last:
# mgr = self.aq_parent.unrestrictedTraverse(d)
# last = d
#
# if callable(f): f(mgr)
for
k
,
v
in
list
(
index
.
items
()):
if
v
is
b
:
self
.
notifyDestruct
(
index
[
k
])
self
.
notifyDestruct
(
index
[
k
]
[
k
]
)
del
index
[
k
]
b
.
clear
()
...
...
@@ -454,6 +465,7 @@ class TransientObjectContainer(SimpleItem):
if
b
is
None
:
# this is a new key
index
[
k
]
=
current
self
.
notifyAdd
(
v
)
elif
b
is
not
current
:
# this is an old key that isn't in the current bucket.
del
b
[
k
]
# delete it from the old bucket
...
...
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