[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/service - __init__.py:1.1.2.2

Jim Fulton jim at zope.com
Fri Sep 12 15:15:47 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/services/service
In directory cvs.zope.org:/tmp/cvs-serv13470/src/zope/app/browser/services/service

Modified Files:
      Tag: parentgeddon-branch
	__init__.py 
Log Message:
Can't have the tests passing, can we?

=== Zope3/src/zope/app/browser/services/service/__init__.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/browser/services/service/__init__.py:1.1.2.1	Mon Sep  8 14:21:30 2003
+++ Zope3/src/zope/app/browser/services/service/__init__.py	Fri Sep 12 15:15:15 2003
@@ -19,8 +19,7 @@
 from zope.app import zapi
 from zope.app.browser.container.adding import Adding
 from zope.app.i18n import ZopeMessageIDFactory as _
-from zope.app.interfaces.container import IAddTarget, INameChooser
-from zope.app.interfaces.container import IRemoveSource
+from zope.app.interfaces.container import INameChooser
 from zope.app.interfaces.services.registration import UnregisteredStatus
 from zope.app.interfaces.services.registration import RegisteredStatus
 from zope.app.interfaces.services.registration import ActiveStatus
@@ -124,15 +123,13 @@
 
     def action(self, name=[], active=[]):
         path = zapi.name(self.context)
-        configure = self.context.__parent__.getRegistrationManager()
-        adder = zapi.getAdapter(configure, IAddTarget)
-        chooser = zapi.getAdapter(configure, INameChooser)
+        rm = self.context.__parent__.getRegistrationManager()
+        chooser = zapi.getAdapter(rm, INameChooser)
 
         for nm in name:
             sc = ServiceRegistration(nm, path, self.context)
             name = chooser.chooseName(nm, sc)
-            name = adder.addObject(name, sc)
-            sc = container[name]
+            rm[name] = sc
             if nm in active:
                 sc.status = ActiveStatus
             else:
@@ -224,8 +221,7 @@
                 conf.status = UnregisteredStatus
                 parent = zapi.getParent(conf)
                 name = zapi.name(conf)
-                remover = zapi.getAdapter(parent, IRemoveSource)
-                remover.removeObject(name)
+                del parent[name]
 
         # 2) Delete the service objects
         # XXX Jim doesn't like this very much; he thinks it's too much
@@ -238,8 +234,7 @@
         for path, obj in services.items():
             parent = zapi.getParent(obj)
             name = zapi.name(obj)
-            remover = zapi.getAdapter(parent, IRemoveSource)
-            remover.removeObject(name)
+            del parent[name]
 
         s = _("Deleted: ${service_names}")
         s.mapping = {'service_names': ", ".join(todo)}




More information about the Zope3-Checkins mailing list