[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/ Fix up several locations for the new import location of object

Philipp von Weitershausen philikon at philikon.de
Thu Apr 6 18:39:51 EDT 2006


Log message for revision 66628:
  Fix up several locations for the new import location of object
  lifecycle events (the provided BBB didn't catch them). The gross
  amount of imports still has to be fixed.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/app/component/back35.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/site.py
  U   Zope3/branches/jim-adapter/src/zope/app/container/contained.py
  U   Zope3/branches/jim-adapter/src/zope/app/container/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/dublincore/browser/metadataedit.py
  U   Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py
  U   Zope3/branches/jim-adapter/src/zope/app/versioncontrol/event.py
  U   Zope3/branches/jim-adapter/src/zope/formlib/form.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/component/back35.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/back35.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/app/component/back35.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -27,6 +27,7 @@
 from zope.interface import implements
 from zope.security.checker import InterfaceChecker, CheckerPublic
 from zope.security.proxy import Proxy, removeSecurityProxy
+from zope.lifecycleevent import ObjectCreatedEvent
 
 import zope.app.component.registration
 import zope.app.component.interfaces.registration
@@ -37,7 +38,6 @@
 from zope.app.component.interfaces import registration as interfaces
 from zope.app.container.btree import BTreeContainer
 from zope.app.container.contained import Contained
-from zope.app.event import objectevent
 from zope.app.i18n import ZopeMessageFactory as _
 
 InactiveStatus = _('Inactive')
@@ -578,8 +578,7 @@
         self.registrationManager = RegistrationManager()
         self.registrationManager.__parent__ = self
         self.registrationManager.__name__ = '++registrations++'
-        zope.event.notify(
-            objectevent.ObjectCreatedEvent(self.registrationManager))
+        zope.event.notify(ObjectCreatedEvent(self.registrationManager))
 
 
 class RegistrationManagerNamespace:

Modified: Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -18,10 +18,10 @@
 import zope.interface
 import zope.event
 from zope.exceptions.interfaces import UserError
+from zope.lifecycleevent import ObjectCreatedEvent
 
 from zope.app import zapi
 from zope.app.component import site, interfaces, browser
-from zope.app.event import objectevent
 from zope.app.i18n import ZopeMessageFactory as _
 
 
@@ -131,7 +131,7 @@
         sm = zapi.getSiteManager()
         if not tool.folder in sm:
             folder = site.SiteManagementFolder()
-            zope.event.notify(objectevent.ObjectCreatedEvent(folder))
+            zope.event.notify(ObjectCreatedEvent(folder))
             sm[tool.folder] = folder
         return sm[tool.folder]
 

Modified: Zope3/branches/jim-adapter/src/zope/app/component/site.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/site.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/app/component/site.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -39,6 +39,7 @@
 from zope.component.interfaces import ComponentLookupError
 from zope.traversing.interfaces import IContainmentRoot
 from zope.security.proxy import removeSecurityProxy
+from zope.lifecycleevent import ObjectCreatedEvent
 
 import zope.app.component.back35
 from zope.app import zapi
@@ -47,7 +48,6 @@
 from zope.app.component.hooks import setSite
 from zope.app.container.btree import BTreeContainer
 from zope.app.container.contained import Contained
-from zope.app.event import objectevent
 from zope.app.filerepresentation.interfaces import IDirectoryFactory
 
 ##############################################################################
@@ -189,7 +189,7 @@
 
         # Setup default site management folder
         folder = SiteManagementFolder()
-        zope.event.notify(objectevent.ObjectCreatedEvent(folder))
+        zope.event.notify(ObjectCreatedEvent(folder))
         self['default'] = folder
 
     def _init_registries(self):

Modified: Zope3/branches/jim-adapter/src/zope/app/container/contained.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/contained.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/app/container/contained.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -27,8 +27,8 @@
 from zope.location.interfaces import ILocation, ISublocations
 from zope.exceptions.interfaces import DuplicationError, UserError
 from zope.security.checker import selectChecker, CombinedChecker
+from zope.lifecycleevent import ObjectModifiedEvent
 
-from zope.app.event.objectevent import ObjectModifiedEvent
 from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.container.interfaces import IContained
 from zope.app.container.interfaces import INameChooser

Modified: Zope3/branches/jim-adapter/src/zope/app/container/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/interfaces.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/app/container/interfaces.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -24,7 +24,7 @@
 from zope.interface.common.mapping import IItemMapping
 from zope.interface.common.mapping import IReadMapping, IEnumerableMapping
 from zope.location.interfaces import ILocation
-from zope.app.event.interfaces import IObjectModifiedEvent
+from zope.lifecycleevent.interfaces import IObjectModifiedEvent
 
 deprecated('IContentContainer',
            'This interface has been deprecated. '

Modified: Zope3/branches/jim-adapter/src/zope/app/dublincore/browser/metadataedit.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dublincore/browser/metadataedit.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/app/dublincore/browser/metadataedit.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -19,9 +19,9 @@
 
 from datetime import datetime
 from zope.event import notify
-from zope.app.event.objectevent import ObjectModifiedEvent
-from zope.app.event.objectevent import Attributes
-from zope.app.i18n import ZopeMessageFactory as _
+from zope.lifecycleevent import ObjectModifiedEvent, Attributes
+from zope.i18nmessageid import MessageFactory
+_ = MessageFactory('zope')
 from zope.app.dublincore.interfaces import IZopeDublinCore
 
 

Modified: Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -18,12 +18,12 @@
 from datetime import datetime
 
 import zope.event
+from zope import lifecycleevent
 from zope.publisher import contenttype
 from zope.schema import Text
 from zope.exceptions.interfaces import UserError
 
 from zope.app import contenttypes
-from zope.app.event import objectevent
 from zope.app.file.file import File
 from zope.app.file.interfaces import IFile
 from zope.app.i18n import ZopeMessageFactory as _
@@ -117,7 +117,7 @@
 
     def update_object(self, data, contenttype):
         f = File(data, contenttype)
-        zope.event.notify(objectevent.ObjectCreatedEvent(f))
+        zope.event.notify(lifecycleevent.ObjectCreatedEvent(f))
         self.context.add(f)
         self.request.response.redirect(self.context.nextURL())
         return ''
@@ -207,14 +207,14 @@
     def update_object(self, data, contenttype):
         self.context.contentType = contenttype
 
-        descriptor = objectevent.Attributes(IFile, "contentType")
+        descriptor = lifecycleevent.Attributes(IFile, "contentType")
 
         # Update *only* if a new value is specified
         if data:
             self.context.data = data
             descriptor.attributes += "data",
 
-        event = objectevent.ObjectModifiedEvent(self.context, descriptor)
+        event = lifecycleevent.ObjectModifiedEvent(self.context, descriptor)
         zope.event.notify(event)
 
         formatter = self.request.locale.dates.getFormatter(

Modified: Zope3/branches/jim-adapter/src/zope/app/versioncontrol/event.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/versioncontrol/event.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/app/versioncontrol/event.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -4,12 +4,11 @@
 __docformat__ = "reStructuredText"
 
 import zope.interface
-
-import zope.app.event.objectevent
+import zope.component.interfaces
 import zope.app.versioncontrol.interfaces
 
 
-class VersionEvent(zope.app.event.objectevent.ObjectEvent):
+class VersionEvent(zope.component.interfaces.ObjectEvent):
 
     def __init__(self, object, info):
         super(VersionEvent, self).__init__(object)

Modified: Zope3/branches/jim-adapter/src/zope/formlib/form.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/formlib/form.py	2006-04-06 22:36:59 UTC (rev 66627)
+++ Zope3/branches/jim-adapter/src/zope/formlib/form.py	2006-04-06 22:39:48 UTC (rev 66628)
@@ -26,14 +26,14 @@
 
 from zope import component, interface, schema
 
+import zope.security
+import zope.interface.interfaces
 from zope.interface.common import idatetime
 from zope.interface.interface import InterfaceClass
-import zope.interface.interfaces
 from zope.schema.interfaces import IField
-import zope.security
+from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
 
 import zope.app.container.interfaces
-import zope.app.event.objectevent
 import zope.app.form.browser.interfaces
 from zope.app.form.interfaces import IInputWidget, IDisplayWidget
 from zope.app.form.interfaces import WidgetsError, MissingInputError
@@ -777,8 +777,7 @@
     @action(_("Apply"), condition=haveInputWidgets)
     def handle_edit_action(self, action, data):
         if applyChanges(self.context, self.form_fields, data, self.adapters):
-            zope.event.notify(
-                zope.app.event.objectevent.ObjectModifiedEvent(self.context))
+            zope.event.notify(ObjectModifiedEvent(self.context))
             formatter = self.request.locale.dates.getFormatter(
                 'dateTime', 'medium')
 
@@ -837,8 +836,7 @@
 
     def createAndAdd(self, data):
         ob = self.create(data)
-        zope.event.notify(
-            zope.app.event.objectevent.ObjectCreatedEvent(ob))
+        zope.event.notify(ObjectCreatedEvent(ob))
         return self.add(ob)
 
     def create(self, data):



More information about the Zope3-Checkins mailing list