[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser - Control.py:1.3 configure.zcml:1.8

Gary Poster gary@modernsongs.com
Mon, 21 Oct 2002 02:15:16 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv13005/Zope/App/OFS/Services/LocalEventService/Views/Browser

Modified Files:
	Control.py configure.zcml 
Log Message:
sorry for the huge honking checkin.

Adds a simple local objecthub implementation and made ObjectHub a service

Modifies the main objecthub as we have been discussing:
 * objecthub attribute is hubid, not hid (sorry Jim, I'll change it back if you want but there were a lot of "yay"s and no "nay"s :-)
 * no more IObjectAddedHubEvent
 * IObjectRemovedEvent now (hopefully) actually has the effect on the ObjectHub that is described in the interface, and that we agreed upon, namely (assuming removed object was cataloged in objecthub) removing catalog of object in objecthub and sending out an IObjectRemovedHubEvent, subclass of IObjectUnregisteredHubEvent, to the ObjectHub subscribers

I tried to spruce up the LocalEventService a bit but the code still looks as opaque as ever, I'm afraid.  Among other small improvements, though, at least you actually can see the silly "user interface" now without a traceback.  Now for a *real* user interface sometime. :-)

Fixed a few typos while I was at it as well...and I'm sure made my share of new ones :-)




=== Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/Control.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/Control.py:1.2	Mon Jun 10 19:28:11 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/Control.py	Mon Oct 21 02:14:46 2002
@@ -19,16 +19,16 @@
 from Zope.Publisher.Browser.BrowserView import BrowserView
 from Zope.ComponentArchitecture.ContextDependent import ContextDependent
 from Zope.Event.IEventService import IEventService
-from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
+from Zope.App.PageTemplate import ViewPageTemplateFile
 from Zope.Proxy.ProxyIntrospection import removeAllProxies
 
 class Control(BrowserView):
     __used_for__ = IEventService
 
-    def index( self, toggleSubscribeOnBind=0, REQUEST=None):
+    def index( self, toggleSubscribeOnBind=0):
         if toggleSubscribeOnBind:
             cntx=removeAllProxies(self.context)
             cntx.subscribeOnBind=not cntx.subscribeOnBind
-        return self.__control(REQUEST)
+        return self.__control()
     
-    __control=PageTemplateFile("control.pt")
+    __control=ViewPageTemplateFile("control.pt")


=== Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/configure.zcml 1.7 => 1.8 ===
--- Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/configure.zcml:1.7	Thu Jul 11 14:21:31 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/LocalEventService/Views/Browser/configure.zcml	Mon Oct 21 02:14:46 2002
@@ -1,21 +1,32 @@
 <zopeConfigure
     xmlns="http://namespaces.zope.org/zope"
-    xmlns:browser="http://namespaces.zope.org/browser">
+    xmlns:browser="http://namespaces.zope.org/browser"
+    package="Zope.App.OFS.Services.LocalEventService">
 
 <browser:defaultView 
-    name="control.html"
-    for="Zope.Event.IEventService+"
+    name="index.html"
+    for="Zope.Event.IEventService+" />
+
+<browser:view 
     permission="Zope.ManageServices" 
-    factory=".Control." />
+    for="Zope.Event.IEventService+"
+    factory=".Views.Browser.Control.">
+
+    <browser:page name="index.html" attribute="index" />
+
+</browser:view>
 
 <browser:menuItems menu="zmi_views" for="Zope.Event.IEventService+">
-  <browser:menuItem title="Control" action="@@control.html" />
+  <browser:menuItem title="Control" action="@@index.html" />
 </browser:menuItems>
 
 <browser:menuItem menu="add_component" 
     for="Zope.App.OFS.Container.IAdding."
     action="Events"  title="Event Service"
     description="An event service: use sparingly" />
+  
+<browser:icon name="zmi_icon" for="Zope.Event.IEventService+" 
+            file="event_service.gif" />
 
 </zopeConfigure>