[Zope3-checkins] CVS: Zope3/src/zope/app/utilities -
content.py:1.11 schema.py:1.19
Jim Fulton
jim at zope.com
Sat Mar 6 11:51:05 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/utilities
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/app/utilities
Modified Files:
content.py schema.py
Log Message:
Converted most getAdapter calls to use interface calls instead.
=== Zope3/src/zope/app/utilities/content.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/utilities/content.py:1.10 Fri Mar 5 17:09:21 2004
+++ Zope3/src/zope/app/utilities/content.py Sat Mar 6 11:50:34 2004
@@ -54,7 +54,7 @@
self.copySchema = copySchema
self.permissions = PersistentDict()
## # This will set up the menu item entry.
-## zapi.getAdapter(self, IContentComponentMenuItem)
+## IContentComponentMenuItem(self)
@@ -67,7 +67,7 @@
def __init__(self, context):
self.context = context
- ann = zapi.getAdapter(context, IAnnotations)
+ ann = IAnnotations(context)
if not ann.has_key(MenuItemKey):
ann[MenuItemKey] = PersistentDict(
{'interface': IAdding,
@@ -268,14 +268,14 @@
"""
component = self.getComponent()
component.name = self.name
- zapi.getAdapter(component, IContentComponentMenuItem).createMenuItem()
+ IContentComponentMenuItem(component).createMenuItem()
def deactivated(self):
"""Once activated, we have to unregister the new Content Object with
the appropriate menu."""
component = self.getComponent()
component.name = None
- zapi.getAdapter(component, IContentComponentMenuItem).removeMenuItem()
+ IContentComponentMenuItem(component).removeMenuItem()
class ContentComponentInstance(Persistent):
=== Zope3/src/zope/app/utilities/schema.py 1.18 => 1.19 ===
--- Zope3/src/zope/app/utilities/schema.py:1.18 Fri Mar 5 10:56:36 2004
+++ Zope3/src/zope/app/utilities/schema.py Sat Mar 6 11:50:34 2004
@@ -264,7 +264,7 @@
def add(self, content):
name = self.contentName
- container = zapi.getAdapter(self.context, IMutableSchema)
+ container = IMutableSchema(self.context)
container.addField(name, content)
return content
More information about the Zope3-Checkins
mailing list