Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
Levin Zimmermann
neoppod
Commits
11473bff
Commit
11473bff
authored
Sep 15, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: make Storage.history() compatible with recent ZODB API
In particular, this fixes history tab on recent Zope.
parent
7d6b9c87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
neo/client/Storage.py
neo/client/Storage.py
+15
-2
neo/client/app.py
neo/client/app.py
+1
-1
No files found.
neo/client/Storage.py
View file @
11473bff
...
@@ -35,6 +35,18 @@ def check_read_only(func):
...
@@ -35,6 +35,18 @@ def check_read_only(func):
return
func
(
self
,
*
args
,
**
kw
)
return
func
(
self
,
*
args
,
**
kw
)
return
wraps
(
func
)(
wrapped
)
return
wraps
(
func
)(
wrapped
)
def
old_history_api
(
func
):
try
:
if
ZODB
.
interfaces
.
IStorage
[
'history'
].
positional
[
1
]
!=
'version'
:
return
func
# ZODB >= 3.9
except
KeyError
:
# ZODB < 3.8
pass
def
history
(
self
,
oid
,
version
=
None
,
*
args
,
**
kw
):
if
version
is
None
:
return
func
(
self
,
oid
,
*
args
,
**
kw
)
raise
ValueError
(
'Versions are not supported'
)
return
wraps
(
func
)(
history
)
class
Storage
(
BaseStorage
.
BaseStorage
,
class
Storage
(
BaseStorage
.
BaseStorage
,
ConflictResolution
.
ConflictResolvingStorage
):
ConflictResolution
.
ConflictResolvingStorage
):
"""Wrapper class for neoclient."""
"""Wrapper class for neoclient."""
...
@@ -215,9 +227,10 @@ class Storage(BaseStorage.BaseStorage,
...
@@ -215,9 +227,10 @@ class Storage(BaseStorage.BaseStorage,
def
registerDB
(
self
,
db
,
limit
=
None
):
def
registerDB
(
self
,
db
,
limit
=
None
):
self
.
app
.
registerDB
(
db
,
limit
)
self
.
app
.
registerDB
(
db
,
limit
)
def
history
(
self
,
oid
,
version
=
None
,
size
=
1
,
filter
=
None
):
@
old_history_api
def
history
(
self
,
*
args
,
**
kw
):
try
:
try
:
return
self
.
app
.
history
(
oid
,
version
,
size
,
filter
)
return
self
.
app
.
history
(
*
args
,
**
kw
)
except
NEOStorageNotFoundError
:
except
NEOStorageNotFoundError
:
raise
KeyError
raise
KeyError
...
...
neo/client/app.py
View file @
11473bff
...
@@ -981,7 +981,7 @@ class Application(object):
...
@@ -981,7 +981,7 @@ class Application(object):
append
(
txn_info
)
append
(
txn_info
)
return
(
tid
,
txn_list
)
return
(
tid
,
txn_list
)
def
history
(
self
,
oid
,
version
=
None
,
size
=
1
,
filter
=
None
):
def
history
(
self
,
oid
,
size
=
1
,
filter
=
None
):
queue
=
self
.
_getThreadQueue
()
queue
=
self
.
_getThreadQueue
()
# Get history informations for object first
# Get history informations for object first
packet
=
Packets
.
AskObjectHistory
(
oid
,
0
,
size
)
packet
=
Packets
.
AskObjectHistory
(
oid
,
0
,
size
)
...
...
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