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
nexedi
ZODB
Commits
7ceb5bd6
Commit
7ceb5bd6
authored
Apr 26, 2007
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed to work with base storages that don't support versions.
Removed unneeded loadEx. Added missing close method.
parent
1f21bc9c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
src/ZODB/DemoStorage.py
src/ZODB/DemoStorage.py
+17
-12
No files found.
src/ZODB/DemoStorage.py
View file @
7ceb5bd6
...
...
@@ -117,7 +117,13 @@ class DemoStorage(BaseStorage):
self
.
_quota
=
quota
self
.
_ltid
=
None
self
.
_clear_temp
()
if
base
is
not
None
and
base
.
versions
():
try
:
versions
=
base
.
versions
except
AttributeError
:
pass
else
:
if
base
.
versions
():
raise
POSException
.
StorageError
(
"Demo base storage has version data"
)
...
...
@@ -212,37 +218,32 @@ class DemoStorage(BaseStorage):
finally
:
self
.
_lock_release
()
def
load
Ex
(
self
,
oid
,
version
):
def
load
(
self
,
oid
,
version
):
self
.
_lock_acquire
()
try
:
try
:
oid
,
pre
,
vdata
,
p
,
tid
=
self
.
_index
[
oid
]
except
KeyError
:
if
self
.
_base
:
return
self
.
_base
.
load
Ex
(
oid
,
version
)
return
self
.
_base
.
load
(
oid
,
version
)
raise
KeyError
(
oid
)
ver
=
""
if
vdata
:
oversion
,
nv
=
vdata
if
oversion
!=
version
:
if
nv
:
# Return the current txn's tid with the non-version
# data.
oid
,
pre
,
vdata
,
p
,
skiptid
=
nv
p
=
nv
[
3
]
else
:
raise
KeyError
(
oid
)
ver
=
oversion
if
p
is
None
:
raise
KeyError
(
oid
)
return
p
,
tid
,
ver
return
p
,
tid
finally
:
self
.
_lock_release
()
def
load
(
self
,
oid
,
version
):
return
self
.
loadEx
(
oid
,
version
)[:
2
]
def
modifiedInVersion
(
self
,
oid
):
self
.
_lock_acquire
()
try
:
...
...
@@ -564,3 +565,7 @@ class DemoStorage(BaseStorage):
def
cleanup
(
self
):
if
self
.
_base
is
not
None
:
self
.
_base
.
cleanup
()
def
close
(
self
):
if
self
.
_base
is
not
None
:
self
.
_base
.
close
()
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