Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
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
Stefane Fermigier
neo
Commits
d9ab77b8
Commit
d9ab77b8
authored
Nov 13, 2013
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: drop support for ZODB < 3.10
parent
c4b2c78b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
16 deletions
+9
-16
neo/client/Storage.py
neo/client/Storage.py
+3
-3
neo/client/__init__.py
neo/client/__init__.py
+1
-4
neo/client/app.py
neo/client/app.py
+4
-8
neo/tests/client/testClientApp.py
neo/tests/client/testClientApp.py
+1
-1
No files found.
neo/client/Storage.py
View file @
d9ab77b8
...
@@ -30,7 +30,7 @@ class Storage(BaseStorage.BaseStorage,
...
@@ -30,7 +30,7 @@ class Storage(BaseStorage.BaseStorage,
ConflictResolution
.
ConflictResolvingStorage
):
ConflictResolution
.
ConflictResolvingStorage
):
"""Wrapper class for neoclient."""
"""Wrapper class for neoclient."""
implements
(
*
filter
(
None
,
(
implements
(
ZODB
.
interfaces
.
IStorage
,
ZODB
.
interfaces
.
IStorage
,
# "restore" missing for the moment, but "store" implements this
# "restore" missing for the moment, but "store" implements this
# interface.
# interface.
...
@@ -41,8 +41,8 @@ class Storage(BaseStorage.BaseStorage,
...
@@ -41,8 +41,8 @@ class Storage(BaseStorage.BaseStorage,
# ZODB.interfaces.IStorageIteration,
# ZODB.interfaces.IStorageIteration,
ZODB
.
interfaces
.
IStorageUndoable
,
ZODB
.
interfaces
.
IStorageUndoable
,
ZODB
.
interfaces
.
IExternalGC
,
ZODB
.
interfaces
.
IExternalGC
,
getattr
(
ZODB
.
interfaces
,
'ReadVerifyingStorage'
,
None
),
# BBB ZODB 3.9
ZODB
.
interfaces
.
ReadVerifyingStorage
,
)
))
)
def
__init__
(
self
,
master_nodes
,
name
,
read_only
=
False
,
def
__init__
(
self
,
master_nodes
,
name
,
read_only
=
False
,
compress
=
None
,
logfile
=
None
,
_app
=
None
,
**
kw
):
compress
=
None
,
logfile
=
None
,
_app
=
None
,
**
kw
):
...
...
neo/client/__init__.py
View file @
d9ab77b8
...
@@ -100,10 +100,7 @@ if 1:
...
@@ -100,10 +100,7 @@ if 1:
# know any legitimate use of DB access outside a transaction.
# know any legitimate use of DB access outside a transaction.
def
afterCompletion
(
self
,
*
ignored
):
def
afterCompletion
(
self
,
*
ignored
):
try
:
self
.
_readCurrent
.
clear
()
self
.
_readCurrent
.
clear
()
except
AttributeError
:
# BBB: ZODB < 3.10
pass
# PATCH: do not call sync()
# PATCH: do not call sync()
self
.
_flush_invalidations
()
self
.
_flush_invalidations
()
Connection
.
afterCompletion
=
afterCompletion
Connection
.
afterCompletion
=
afterCompletion
neo/client/app.py
View file @
d9ab77b8
...
@@ -641,14 +641,14 @@ class Application(object):
...
@@ -641,14 +641,14 @@ class Application(object):
# A later serial has already been resolved, skip.
# A later serial has already been resolved, skip.
resolved_serial_set
.
update
(
conflict_serial_set
)
resolved_serial_set
.
update
(
conflict_serial_set
)
continue
continue
# BBB: On ZODB < 3.10, tryToResolveConflict returns None
# instead of raising ConflictError.
try
:
try
:
new_data
=
tryToResolveConflict
(
oid
,
conflict_serial
,
new_data
=
tryToResolveConflict
(
oid
,
conflict_serial
,
serial
,
data
)
serial
,
data
)
except
ConflictError
:
except
ConflictError
:
new_data
=
None
logging
.
info
(
'Conflict resolution failed for '
if
new_data
is
not
None
:
'%r:%r with %r'
,
dump
(
oid
),
dump
(
serial
),
dump
(
conflict_serial
))
else
:
logging
.
info
(
'Conflict resolution succeeded for '
logging
.
info
(
'Conflict resolution succeeded for '
'%r:%r with %r'
,
dump
(
oid
),
dump
(
serial
),
'%r:%r with %r'
,
dump
(
oid
),
dump
(
serial
),
dump
(
conflict_serial
))
dump
(
conflict_serial
))
...
@@ -660,10 +660,6 @@ class Application(object):
...
@@ -660,10 +660,6 @@ class Application(object):
self
.
_store
(
txn_context
,
oid
,
conflict_serial
,
new_data
)
self
.
_store
(
txn_context
,
oid
,
conflict_serial
,
new_data
)
append
(
oid
)
append
(
oid
)
continue
continue
else
:
logging
.
info
(
'Conflict resolution failed for '
'%r:%r with %r'
,
dump
(
oid
),
dump
(
serial
),
dump
(
conflict_serial
))
raise
ConflictError
(
oid
=
oid
,
serials
=
(
conflict_serial
,
raise
ConflictError
(
oid
=
oid
,
serials
=
(
conflict_serial
,
serial
),
data
=
data
)
serial
),
data
=
data
)
return
result
return
result
...
...
neo/tests/client/testClientApp.py
View file @
d9ab77b8
...
@@ -62,7 +62,7 @@ def resolving_tryToResolveConflict(oid, conflict_serial, serial, data):
...
@@ -62,7 +62,7 @@ def resolving_tryToResolveConflict(oid, conflict_serial, serial, data):
return
data
return
data
def
failing_tryToResolveConflict
(
oid
,
conflict_serial
,
serial
,
data
):
def
failing_tryToResolveConflict
(
oid
,
conflict_serial
,
serial
,
data
):
r
eturn
None
r
aise
ConflictError
class
ClientApplicationTests
(
NeoUnitTestBase
):
class
ClientApplicationTests
(
NeoUnitTestBase
):
...
...
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