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

Fred L. Drake, Jr. fred@zope.com
Tue, 1 Jul 2003 15:20:46 -0400


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

Modified Files:
	__init__.py 
Log Message:
- use zope.app.zapi in more places
- fix another use of resolve()


=== Zope3/src/zope/app/browser/services/utility/__init__.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/services/utility/__init__.py:1.5	Tue Jul  1 15:03:59 2003
+++ Zope3/src/zope/app/browser/services/utility/__init__.py	Tue Jul  1 15:20:45 2003
@@ -23,7 +23,6 @@
 from zope.app.interfaces.services.registration import ActiveStatus
 from zope.app.interfaces.services.registration import RegisteredStatus
 from zope.app.interfaces.services.registration import UnregisteredStatus
-from zope.app.traversing import getPath, getParent, getName
 from zope.app import zapi
 from zope.interface import providedBy
 from zope.proxy import removeAllProxies
@@ -77,11 +76,11 @@
             if doActivate or doDeactivate or doDelete:
                 return "Please select at least one checkbox"
             return None
-        sm = zapi.getServiceManager(self.context)
+        folder = zapi.getParent(self.context)
         todo = []
         for key in selected:
             name, ifacename = key.split(":", 1)
-            iface = sm.resolve(ifacename)
+            iface = folder.resolve(ifacename)
             todo.append((key, name, iface))
         if doActivate:
             return self._activate(todo)
@@ -146,18 +145,18 @@
                 if first:
                     done.append(conf.usageSummary())
                     first = False
-                path = getPath(obj)
+                path = zapi.getPath(obj)
                 services[path] = obj
                 conf.status = UnregisteredStatus
-                parent = getParent(conf)
-                name = getName(conf)
+                parent = zapi.getParent(conf)
+                name = zapi.getName(conf)
                 container = zapi.getAdapter(parent, IZopeContainer)
                 del container[name]
 
         # 2) Delete the service objects
         for path, obj in services.items():
-            parent = getParent(obj)
-            name = getName(obj)
+            parent = zapi.getParent(obj)
+            name = zapi.getName(obj)
             container = zapi.getAdapter(parent, IZopeContainer)
             del container[name]