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
b7e21335
Commit
b7e21335
authored
Nov 08, 2001
by
matt@zope.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add isValid test to has_key.
parent
bcf8b26d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
lib/python/Products/Transience/Transience.py
lib/python/Products/Transience/Transience.py
+6
-4
No files found.
lib/python/Products/Transience/Transience.py
View file @
b7e21335
...
...
@@ -85,10 +85,10 @@
"""
Core session tracking SessionData class.
$Id: Transience.py,v 1.1
4 2001/11/08 21:03:4
8 matt Exp $
$Id: Transience.py,v 1.1
5 2001/11/08 21:15:2
8 matt Exp $
"""
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
5
$'
[
11
:
-
2
]
import
Globals
from
Globals
import
HTMLFile
,
MessageDialog
...
...
@@ -222,7 +222,7 @@ class TransientObjectContainer(SimpleItem):
def
new
(
self
,
key
,
wrap_with
=
None
):
if
type
(
key
)
is
not
type
(
''
):
raise
TypeError
,
(
key
,
"key is not a string type"
)
if
self
.
has_key
(
key
)
:
if
self
.
get
(
key
,
None
)
is
not
None
:
if
self
[
key
].
isValid
():
raise
KeyError
,
key
# Not allowed to dup keys
del
self
[
key
]
...
...
@@ -520,7 +520,9 @@ class TransientObjectContainer(SimpleItem):
def
has_key
(
self
,
k
):
self
.
_getCurrentBucket
()
index
=
self
.
_ring
.
_index
return
index
.
get
(
k
,
_notfound
)
is
not
_notfound
v
=
index
.
get
(
k
,
_notfound
)
if
v
is
_notfound
or
not
v
.
isValid
():
return
0
return
1
def
values
(
self
):
return
map
(
lambda
k
,
self
=
self
:
self
[
k
],
self
.
keys
())
...
...
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