[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container -
adding.py:1.48
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 9 07:39:34 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv9939/src/zope/app/browser/container
Modified Files:
adding.py
Log Message:
Adjusted code to use utility service to look up factories or use the new zapi
methods.
=== Zope3/src/zope/app/browser/container/adding.py 1.47 => 1.48 ===
--- Zope3/src/zope/app/browser/container/adding.py:1.47 Mon Mar 8 18:33:56 2004
+++ Zope3/src/zope/app/browser/container/adding.py Tue Mar 9 07:39:03 2004
@@ -24,6 +24,7 @@
from zope.interface import implements
from zope.publisher.interfaces import IPublishTraverse
from zope.proxy import removeAllProxies
+from zope.component.interfaces import IFactory
from zope.app.interfaces.exceptions import UserError
from zope.app.container.interfaces import IAdding
@@ -154,7 +155,7 @@
# then ProxyFactory does not the right thing and the original's
# checker info gets lost. No factory that was registered via ZCML
# and was used via addMenuItem worked here. (SR)
- factory = zapi.getFactory(self, type_name)
+ factory = zapi.getUtility(self, IFactory, type_name)
if not type(factory) is zope.security.checker.Proxy:
factory = LocationProxy(factory, self, type_name)
factory = zope.security.checker.ProxyFactory(factory)
@@ -196,7 +197,7 @@
if extra:
factory = extra.get('factory')
if factory:
- factory = zapi.getFactory(container, factory)
+ factory = zapi.getUtility(container, IFactory, factory)
if not checkFactory(container, None, factory):
continue
elif item['extra']['factory'] != item['action']:
More information about the Zope3-Checkins
mailing list