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
c0d06b71
Commit
c0d06b71
authored
Nov 18, 2011
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed dependency on zope.event, while retaining zope.event support
parent
e17bbd1d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
8 deletions
+20
-8
setup.py
setup.py
+0
-1
src/CHANGES.txt
src/CHANGES.txt
+8
-0
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+2
-2
src/ZEO/tests/drop_cache_rather_than_verify.txt
src/ZEO/tests/drop_cache_rather_than_verify.txt
+5
-3
src/ZODB/tests/testZODB.py
src/ZODB/tests/testZODB.py
+5
-2
No files found.
setup.py
View file @
c0d06b71
...
...
@@ -197,7 +197,6 @@ setup(name="ZODB3",
'zc.lockfile'
,
'ZConfig'
,
'zdaemon'
,
'zope.event'
,
'zope.interface'
,
],
zip_safe
=
False
,
...
...
src/CHANGES.txt
View file @
c0d06b71
...
...
@@ -5,6 +5,14 @@
3.11.0 (2010-??-??)
===================
New Features
------------
- ZODB no-longer depends on zope.event. It now uses ZODB.event, which
uses zope.event if it is installed. You can override
ZODB.event.notify to provide your own event handling, although
zope.event is recommended.
Bugs Fixed
----------
...
...
src/ZEO/ClientStorage.py
View file @
c0d06b71
...
...
@@ -46,7 +46,7 @@ import ZEO.interfaces
import
ZODB
import
ZODB.BaseStorage
import
ZODB.interfaces
import
zope
.event
import
ZODB
.event
import
zope.interface
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -1384,7 +1384,7 @@ class ClientStorage(object):
self
.
_cache
.
setLastTid
(
server_tid
)
zope
.
event
.
notify
(
ZEO
.
interfaces
.
StaleCache
(
self
))
ZODB
.
event
.
notify
(
ZEO
.
interfaces
.
StaleCache
(
self
))
# From this point on, we do not have complete information about
# the missed transactions. The reason is that cache
...
...
src/ZEO/tests/drop_cache_rather_than_verify.txt
View file @
c0d06b71
...
...
@@ -56,14 +56,16 @@ And create another client and write some data to it:
Now, we'll restart the server. Before we do that, we'll capture
logging and event data:
>>> import logging, zope.testing.loggingsupport,
zope
.event
>>> import logging, zope.testing.loggingsupport,
ZODB
.event
>>> handler = zope.testing.loggingsupport.InstalledHandler(
... 'ZEO.ClientStorage', level=logging.ERROR)
>>> events = []
>>> def event_handler(e):
... events.append((
... len(e.storage._cache), str(handler), e.__class__.__name__))
>>> zope.event.subscribers.append(event_handler)
>>> old_notify = ZODB.event.notify
>>> ZODB.event.notify = event_handler
Note that the event handler is saving away the length of the cache and
the state of the log handler. We'll use this to show that the event
...
...
@@ -213,4 +215,4 @@ invalidated during verification.
>>> db.close()
>>> handler.uninstall()
>>>
zope.event.subscribers.remove(event_handler)
>>>
ZODB.event.notify = old_notify
src/ZODB/tests/testZODB.py
View file @
c0d06b71
...
...
@@ -17,6 +17,7 @@ from persistent.mapping import PersistentMapping
from
ZODB.POSException
import
ReadConflictError
from
ZODB.POSException
import
TransactionFailedError
import
doctest
import
transaction
import
unittest
import
ZODB
...
...
@@ -611,8 +612,10 @@ class PoisonedObject:
self
.
_p_jar
=
poisonedjar
def
test_suite
():
suite
=
unittest
.
makeSuite
(
ZODBTests
,
'check'
)
return
suite
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
ZODBTests
,
'check'
),
doctest
.
DocTestSuite
(
'ZODB.event'
),
))
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
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