Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
07766aca
Commit
07766aca
authored
Apr 22, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guard against not having a base in all cases.
parent
7f38c7b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
src/ZODB/DemoStorage.py
src/ZODB/DemoStorage.py
+12
-10
No files found.
src/ZODB/DemoStorage.py
View file @
07766aca
...
@@ -79,7 +79,7 @@ method::
...
@@ -79,7 +79,7 @@ method::
and call it to monitor the storage.
and call it to monitor the storage.
"""
"""
__version__
=
'$Revision: 1.1
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
8
$'
[
11
:
-
2
]
import
base64
,
time
,
string
import
base64
,
time
,
string
from
ZODB
import
POSException
,
BaseStorage
,
utils
from
ZODB
import
POSException
,
BaseStorage
,
utils
...
@@ -90,7 +90,6 @@ from BTrees import OOBTree
...
@@ -90,7 +90,6 @@ from BTrees import OOBTree
class
DemoStorage
(
BaseStorage
.
BaseStorage
):
class
DemoStorage
(
BaseStorage
.
BaseStorage
):
def
__init__
(
self
,
name
=
'Demo Storage'
,
base
=
None
,
quota
=
None
):
def
__init__
(
self
,
name
=
'Demo Storage'
,
base
=
None
,
quota
=
None
):
BaseStorage
.
BaseStorage
.
__init__
(
self
,
name
,
base
)
BaseStorage
.
BaseStorage
.
__init__
(
self
,
name
,
base
)
# We use a BTree because the items are sorted!
# We use a BTree because the items are sorted!
...
@@ -226,13 +225,16 @@ class DemoStorage(BaseStorage.BaseStorage):
...
@@ -226,13 +225,16 @@ class DemoStorage(BaseStorage.BaseStorage):
self
.
_lock_acquire
()
self
.
_lock_acquire
()
try
:
try
:
old
=
self
.
_index
.
get
(
oid
,
None
)
old
=
self
.
_index
.
get
(
oid
,
None
)
if
old
is
None
:
if
old
is
None
:
# Hm, nothing here, check the base version:
# Hm, nothing here, check the base version:
try
:
p
,
oserial
=
self
.
_base
.
load
(
oid
,
''
)
if
self
.
_base
:
except
:
pass
try
:
p
,
oserial
=
self
.
_base
.
load
(
oid
,
''
)
except
KeyError
:
pass
else
:
else
:
old
=
oid
,
oserial
,
None
,
None
,
p
old
=
oid
,
oserial
,
None
,
None
,
p
nv
=
None
nv
=
None
if
old
:
if
old
:
...
@@ -453,7 +455,7 @@ class DemoStorage(BaseStorage.BaseStorage):
...
@@ -453,7 +455,7 @@ class DemoStorage(BaseStorage.BaseStorage):
# Scan non-version pickle for references
# Scan non-version pickle for references
r
=
index
.
get
(
oid
,
None
)
r
=
index
.
get
(
oid
,
None
)
if
r
is
None
:
if
r
is
None
:
# Base storage
if
self
.
_base
:
p
,
s
=
self
.
_base
.
load
(
oid
,
''
)
p
,
s
=
self
.
_base
.
load
(
oid
,
''
)
referencesf
(
p
,
rootl
)
referencesf
(
p
,
rootl
)
else
:
else
:
...
...
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