[Zope3-checkins]
SVN: Zope3/branches/jim-simplifyevents/src/zope/app/
Changed all calls to zope.app.event.publish to use
zope.event.notify.
Jim Fulton
jim at zope.com
Wed May 26 16:37:59 EDT 2004
Log message for revision 25027:
Changed all calls to zope.app.event.publish to use zope.event.notify.
-=-
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/adapter/browser/__init__.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/adapter/browser/__init__.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/adapter/browser/__init__.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -34,7 +34,7 @@
from zope.app.registration.interfaces import IRegistration
from zope.app.form.interfaces import IInputWidget
from zope.app.form.utility import applyWidgetsChanges
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.app.adapter.adapter import AdapterRegistration
@@ -48,7 +48,7 @@
if "FINISH" in self.request:
data = getWidgetsData(self, IAdapterRegistration)
registration = AdapterRegistration(**data)
- publish(self.context.context, ObjectCreatedEvent(registration))
+ notify(ObjectCreatedEvent(registration))
registration = self.context.add(registration)
applyWidgetsChanges(view, IRegistration, target=registration)
self.request.response.redirect(self.context.nextURL())
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/appsetup/appsetup.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/appsetup/appsetup.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/appsetup/appsetup.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -88,7 +88,7 @@
db = DB(storage, cache_size=4000)
# The following will fail unless the application has been configured.
- from zope.app.event import publish
- publish(None, DatabaseOpened(db))
+ from zope.event import notify
+ notify(DatabaseOpened(db))
return db
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/container/browser/adding.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/container/browser/adding.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/container/browser/adding.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -33,7 +33,7 @@
from zope.app import zapi
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from zope.app.event import publish
+from zope.event import notify
from zope.app.publisher.browser import BrowserView
from zope.app.i18n import ZopeMessageIDFactory as _
@@ -150,7 +150,7 @@
# into unproxying an existing object,
content = removeAllProxies(content)
- publish(self.context, ObjectCreatedEvent(content))
+ notify(ObjectCreatedEvent(content))
self.add(content)
self.request.response.redirect(self.nextURL())
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/container/contained.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/container/contained.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/container/contained.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -27,7 +27,7 @@
from zope.app.exception.interfaces import UserError
from zope.app.event.objectevent import ObjectEvent, modified
-from zope.app.event import publish
+from zope.event import notify
from zope.app.i18n import ZopeMessageIDFactory as _
from zope.app.container.interfaces import IContained
from zope.app.container.interfaces import INameChooser
@@ -441,7 +441,7 @@
object, event = containedEvent(object, container, name)
setitemf(name, object)
if event:
- publish(container, event)
+ notify(event)
modified(container)
fixing_up = False
@@ -542,7 +542,7 @@
return
event = ObjectRemovedEvent(object, oldparent, oldname)
- publish(container, event)
+ notify(event)
object.__parent__ = None
object.__name__ = None
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/copypastemove/__init__.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/copypastemove/__init__.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/copypastemove/__init__.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -20,7 +20,7 @@
from zope.app import zapi
from zope.app.container.sample import SampleContainer
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCopiedEvent
from zope.app.copypastemove.interfaces import IObjectMover
from zope.app.copypastemove.interfaces import IObjectCopier
@@ -374,7 +374,7 @@
copy = removeAllProxies(obj)
copy = locationCopy(copy)
copy.__parent__ = copy.__name__ = None
- publish(target, ObjectCopiedEvent(copy))
+ notify(ObjectCopiedEvent(copy))
target[new_name] = copy
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/dav/mkcol.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/dav/mkcol.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/dav/mkcol.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -16,7 +16,7 @@
from zope.app import zapi
from zope.app.filerepresentation.interfaces import IWriteDirectory
from zope.app.filerepresentation.interfaces import IDirectoryFactory
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
class NullResource(object):
@@ -46,7 +46,7 @@
factory = IDirectoryFactory(container)
newdir = factory(name)
- publish(self.context, ObjectCreatedEvent(newdir))
+ notify(ObjectCreatedEvent(newdir))
dir[name] = newdir
request.response.setStatus(201)
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/demo/jobboard/browser.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/demo/jobboard/browser.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/demo/jobboard/browser.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -1,6 +1,6 @@
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
from zope.app.publisher.browser import BrowserView
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent, ObjectModifiedEvent
@@ -38,7 +38,7 @@
# Validation code should go here
job = Job(submitter, summary, description, contact)
self.context.add(job)
- publish(self.context,ObjectModifiedEvent(self.context))
+ notify(ObjectModifiedEvent(self.context))
return self.thanks()
@@ -100,5 +100,5 @@
response.redirect('review.html')
else:
response.redirect('.')
- publish(self.context,ObjectModifiedEvent(self.context))
+ notify(ObjectModifiedEvent(self.context))
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/demo/jobboard/job.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/demo/jobboard/job.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/demo/jobboard/job.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -47,7 +47,7 @@
from persistent.dict import PersistentDict
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
class JobList(Persistent):
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/dublincore/browser/metadataedit.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/dublincore/browser/metadataedit.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/dublincore/browser/metadataedit.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -16,7 +16,7 @@
$Id$
"""
from datetime import datetime
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectAnnotationsModifiedEvent
from zope.app.i18n import ZopeMessageIDFactory as _
from zope.app.dublincore.interfaces import IZopeDublinCore
@@ -35,7 +35,7 @@
if 'dctitle' in request:
dc.title = request['dctitle']
dc.description = request['dcdescription']
- publish(self.context, ObjectAnnotationsModifiedEvent(self.context))
+ notify(ObjectAnnotationsModifiedEvent(self.context))
message = _("Changed data ${datetime}")
message.mapping = {'datetime': formatter.format(datetime.utcnow())}
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/event/dispatching.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/event/dispatching.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/event/dispatching.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -56,6 +56,7 @@
$Id$
"""
+from warnings import warn
from zope.component import subscribers
import zope.event
@@ -66,4 +67,6 @@
zope.event.subscribers.append(dispatch)
def publish(context, event):
+ warn("Use zope.event.notify rather than zope.app.event.publish",
+ DeprecationWarning, 2)
zope.event.notify(event)
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/event/objectevent.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/event/objectevent.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/event/objectevent.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -24,7 +24,7 @@
from zope.app.event.interfaces import IObjectAnnotationsModifiedEvent
from zope.app.event.interfaces import IObjectContentModifiedEvent
from zope.interface import implements
-from zope.app.event import publish
+from zope.event import notify
from zope.component import subscribers
_marker = object()
@@ -48,7 +48,7 @@
implements(IObjectModifiedEvent)
def modified(object):
- publish(object, ObjectModifiedEvent(object))
+ notify(ObjectModifiedEvent(object))
class ObjectAnnotationsModifiedEvent(ObjectModifiedEvent):
"""An object's annotations have been modified"""
@@ -56,7 +56,7 @@
implements(IObjectAnnotationsModifiedEvent)
def annotationModified(object):
- publish(object, ObjectAnnotationModifiedEvent(object))
+ notify(ObjectAnnotationModifiedEvent(object))
class ObjectContentModifiedEvent(ObjectModifiedEvent):
"""An object's content has been modified"""
@@ -64,7 +64,7 @@
implements(IObjectContentModifiedEvent)
def contentModified(object):
- publish(object, ObjectContentModifiedEvent(object))
+ notify(ObjectContentModifiedEvent(object))
class ObjectCopiedEvent(ObjectCreatedEvent):
"""An object has been copied"""
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/add.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/add.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/add.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -18,7 +18,7 @@
import sys
from zope.app import zapi
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.app.form.utility import setUpWidgets, getWidgetsData
from zope.app.i18n import ZopeMessageIDFactory as _
@@ -103,7 +103,7 @@
if errors:
raise WidgetsError(*errors)
- publish(self.context, ObjectCreatedEvent(content))
+ notify(ObjectCreatedEvent(content))
content = self.add(content)
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/addwizard.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/addwizard.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/addwizard.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -18,7 +18,7 @@
import sys
from zope.app import zapi
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.app.form.utility import setUpWidgets
from zope.app.form.interfaces import WidgetsError, IInputWidget
@@ -87,7 +87,7 @@
if errors:
raise WidgetsError(*errors)
- publish(self.context, ObjectCreatedEvent(content))
+ notify(ObjectCreatedEvent(content))
content = self.context.add(content)
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/editview.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/editview.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/editview.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -23,7 +23,7 @@
from zope.component import getAdapter
from zope.app import zapi
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectModifiedEvent
from zope.app.i18n import ZopeMessageIDFactory as _
from zope.app.form.interfaces import WidgetsError
@@ -100,7 +100,7 @@
# We should not generate events when an adapter is used.
# That's the adapter's job.
if changed and self.context is self.adapted:
- publish(content, ObjectModifiedEvent(content))
+ notify(ObjectModifiedEvent(content))
except WidgetsError, errors:
self.errors = errors
status = _("An error occured.")
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/editwizard.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/editwizard.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/form/browser/editwizard.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -21,7 +21,7 @@
from zope.security.checker import defineChecker, NamesChecker
from zope.app import zapi
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectModifiedEvent
from zope.app.i18n import ZopeMessageIDFactory as _
from zope.app.location.interfaces import ILocation
@@ -183,7 +183,7 @@
# We should not generate events when an adapter is used.
# That's the adapter's job
if changed and self.context is self.adapted:
- publish(content, ObjectModifiedEvent(content))
+ notify(ObjectModifiedEvent(content))
return not changed
def renderHidden(self):
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/fssync/committer.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/fssync/committer.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/fssync/committer.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -32,7 +32,7 @@
from zope.app.traversing.api import traverseName, getName
from zope.app.filerepresentation.interfaces import IFileFactory
from zope.app.filerepresentation.interfaces import IDirectoryFactory
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.app.event.objectevent import ObjectModifiedEvent
from zope.app.container.contained import contained
@@ -359,7 +359,7 @@
except:
pass
else:
- publish(obj, ObjectModifiedEvent(obj))
+ notify(ObjectModifiedEvent(obj))
def create_object(self, container, name, entry, fspath, replace=False,
context=None):
@@ -428,7 +428,7 @@
"""Helper to set an item in a container or mapping."""
if IContainer.providedBy(container):
if not replace:
- publish(container, ObjectCreatedEvent(obj))
+ notify(ObjectCreatedEvent(obj))
if replace:
del container[name]
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/ftp/__init__.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/ftp/__init__.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/ftp/__init__.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -29,7 +29,7 @@
from zope.app.filerepresentation.interfaces import IFileFactory
from zope.app.filerepresentation.interfaces import IDirectoryFactory
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.app.dublincore.interfaces import IZopeDublinCore
from zope.app.copypastemove import rename
@@ -144,7 +144,7 @@
dir = IWriteDirectory(self.context, None)
factory = IDirectoryFactory(self.context)
newdir = factory(name)
- publish(self.context, ObjectCreatedEvent(newdir))
+ notify(ObjectCreatedEvent(newdir))
dir[name] = newdir
def remove(self, name):
@@ -213,7 +213,7 @@
factory = IFileFactory(self.context)
newfile = factory(name, '', data)
- publish(self.context, ObjectCreatedEvent(newfile))
+ notify(ObjectCreatedEvent(newfile))
dir[name] = newfile
def writable(self, name):
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/http/put.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/http/put.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/http/put.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -17,7 +17,7 @@
from zope.app.http.interfaces import INullResource
from zope.app.filerepresentation.interfaces import IWriteFile
from zope.app.filerepresentation.interfaces import IWriteDirectory, IFileFactory
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.interface import implements
@@ -76,7 +76,7 @@
data = body.read()
newfile = factory(name, request.getHeader('content-type', ''), data)
- publish(self.context, ObjectCreatedEvent(newfile))
+ notify(ObjectCreatedEvent(newfile))
dir[name] = newfile
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/module/browser/__init__.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/module/browser/__init__.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/module/browser/__init__.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -16,7 +16,7 @@
$Id$
"""
from zope.app.module import Manager
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.app.publisher.browser import BrowserView
from zope.proxy import removeAllProxies
@@ -35,7 +35,7 @@
mgr = self.context.add(mgr) # local registration
mgr.execute()
self.request.response.redirect(self.context.nextURL())
- publish(self.context.context, ObjectCreatedEvent(mgr))
+ notify(ObjectCreatedEvent(mgr))
class EditModule(BrowserView):
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/publication/zopepublication.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/publication/zopepublication.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/publication/zopepublication.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -46,7 +46,7 @@
from zope.app.publication.publicationtraverse import PublicationTraverse
from zope.app.traversing.interfaces import IPhysicallyLocatable
from zope.app.location import LocationProxy
-from zope.app.event import publish
+from zope.event import notify
from zope.app.publication.interfaces import BeforeTraverseEvent
from zope.app.publication.interfaces import EndRequestEvent
@@ -110,7 +110,7 @@
def callTraversalHooks(self, request, ob):
# Call __before_publishing_traverse__ hooks
- publish(None, BeforeTraverseEvent(ob, request))
+ notify(BeforeTraverseEvent(ob, request))
# This is also a handy place to try and authenticate.
self._maybePlacefullyAuthenticate(request, ob)
@@ -160,7 +160,7 @@
def endRequest(self, request, ob):
endInteraction()
- publish(None, EndRequestEvent(ob, request))
+ notify(EndRequestEvent(ob, request))
def annotateTransaction(self, txn, request, ob):
"""Set some useful meta-information on the transaction. This
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/server/main.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/server/main.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/server/main.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -26,7 +26,7 @@
import ThreadedAsync
import zope.app.appsetup
-from zope.app.event import publish
+from zope.event import notify
from zope.server.taskthreads import ThreadedTaskDispatcher
CONFIG_FILENAME = "zope.conf"
@@ -89,7 +89,7 @@
db = options.database.open()
- publish(None, zope.app.appsetup.DatabaseOpened(db))
+ notify(zope.app.appsetup.DatabaseOpened(db))
task_dispatcher = ThreadedTaskDispatcher()
task_dispatcher.setThreadCount(options.threads)
@@ -97,4 +97,4 @@
for server in options.servers:
server.create(task_dispatcher, db)
- publish(None, zope.app.appsetup.ProcessStarting())
+ notify(zope.app.appsetup.ProcessStarting())
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/workflow/stateful/definition.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/workflow/stateful/definition.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/workflow/stateful/definition.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -24,7 +24,7 @@
from zope.app.container.interfaces import IReadContainer
from zope.app.container.contained import Contained, containedEvent
-from zope.app.event import publish
+from zope.event import notify
from zope.app.event.objectevent import ObjectEvent, modified
from zope.app.workflow.definition import ProcessDefinition
from zope.app.workflow.definition import ProcessDefinitionElementContainer
@@ -118,7 +118,7 @@
def _publishModified(self, name, object):
object, event = containedEvent(object, self, name)
if event:
- publish(self, event)
+ notify(event)
modified(self)
def getRelevantDataSchema(self):
Modified: Zope3/branches/jim-simplifyevents/src/zope/app/workflow/stateful/instance.py
===================================================================
--- Zope3/branches/jim-simplifyevents/src/zope/app/workflow/stateful/instance.py 2004-05-26 20:21:58 UTC (rev 25026)
+++ Zope3/branches/jim-simplifyevents/src/zope/app/workflow/stateful/instance.py 2004-05-26 20:37:58 UTC (rev 25027)
@@ -19,7 +19,7 @@
from persistent.dict import PersistentDict
from zope.app import zapi
-from zope.app.event import publish
+from zope.event import notify
from zope.app.workflow.interfaces import IProcessDefinition
from zope.app.workflow.stateful.interfaces import AUTOMATIC
from zope.app.workflow.stateful.interfaces import IAfterTransitionEvent
@@ -125,14 +125,14 @@
process = self.__parent__
# Send an Event before RelevantData changes
oldvalue = getattr(self, key, None)
- publish(self, BeforeRelevantDataChangeEvent(
+ notify(BeforeRelevantDataChangeEvent(
process, self.__schema, key, oldvalue, value))
super(RelevantData, self).__setattr__(key, value)
if is_schema_field:
# Send an Event after RelevantData has changed
- publish(self, AfterRelevantDataChangeEvent(
+ notify(AfterRelevantDataChangeEvent(
process, self.__schema, key, oldvalue, value))
def getChecker(self):
@@ -204,13 +204,13 @@
obj = getParent(self)
# Send an event before the transition occurs.
- publish(self, BeforeTransitionEvent(obj, self, transition))
+ notify(BeforeTransitionEvent(obj, self, transition))
# change status
self._status = transition.destinationState
# Send an event after the transition occured.
- publish(self, AfterTransitionEvent(obj, self, transition))
+ notify(AfterTransitionEvent(obj, self, transition))
# check for automatic transitions and fire them if necessary
self._checkAndFireAuto(clean_pd)
More information about the Zope3-Checkins
mailing list