[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container -
adding.py:1.46 contents.py:1.36 find.py:1.8
Jim Fulton
jim at zope.com
Sat Mar 6 11:50:44 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/app/browser/container
Modified Files:
adding.py contents.py find.py
Log Message:
Converted most getAdapter calls to use interface calls instead.
=== Zope3/src/zope/app/browser/container/adding.py 1.45 => 1.46 ===
--- Zope3/src/zope/app/browser/container/adding.py:1.45 Fri Mar 5 17:08:53 2004
+++ Zope3/src/zope/app/browser/container/adding.py Sat Mar 6 11:50:12 2004
@@ -49,7 +49,7 @@
"""
container = self.context
name = self.contentName
- chooser = zapi.getAdapter(container, INameChooser)
+ chooser = INameChooser(container)
if IContainerNamesContainer.providedBy(container):
# The container pick's it's own names.
=== Zope3/src/zope/app/browser/container/contents.py 1.35 => 1.36 ===
--- Zope3/src/zope/app/browser/container/contents.py:1.35 Fri Mar 5 17:08:53 2004
+++ Zope3/src/zope/app/browser/container/contents.py Sat Mar 6 11:50:12 2004
@@ -201,7 +201,7 @@
new = request.get("new_value")
item = self.context[id]
- dc = zapi.getAdapter(item, IDCDescriptiveProperties)
+ dc = IDCDescriptiveProperties(item)
dc.title = new
def addObject(self):
@@ -249,7 +249,7 @@
user = self.request.user
annotationsvc = zapi.getService(self.context, 'PrincipalAnnotation')
annotations = annotationsvc.getAnnotations(user)
- clipboard = zapi.getAdapter(annotations, IPrincipalClipboard)
+ clipboard = IPrincipalClipboard(annotations)
clipboard.clearContents()
items = []
for id in ids:
@@ -269,7 +269,7 @@
user = self.request.user
annotationsvc = zapi.getService(self.context, 'PrincipalAnnotation')
annotations = annotationsvc.getAnnotations(user)
- clipboard = zapi.getAdapter(annotations, IPrincipalClipboard)
+ clipboard = IPrincipalClipboard(annotations)
clipboard.clearContents()
items = []
for id in ids:
@@ -284,7 +284,7 @@
user = self.request.user
annotationsvc = zapi.getService(self.context, 'PrincipalAnnotation')
annotations = annotationsvc.getAnnotations(user)
- clipboard = zapi.getAdapter(annotations, IPrincipalClipboard)
+ clipboard = IPrincipalClipboard(annotations)
items = clipboard.getContents()
for item in items:
try:
@@ -293,11 +293,11 @@
pass
else:
if item['action'] == 'cut':
- mover = zapi.getAdapter(obj, IObjectMover)
+ mover = IObjectMover(obj)
if not mover.moveableTo(target):
return False
elif item['action'] == 'copy':
- copier = zapi.getAdapter(obj, IObjectCopier)
+ copier = IObjectCopier(obj)
if not copier.copyableTo(target):
return False
else:
@@ -313,7 +313,7 @@
user = self.request.user
annotationsvc = zapi.getService(self.context, 'PrincipalAnnotation')
annotations = annotationsvc.getAnnotations(user)
- clipboard = zapi.getAdapter(annotations, IPrincipalClipboard)
+ clipboard = IPrincipalClipboard(annotations)
items = clipboard.getContents()
moved = False
for item in items:
@@ -323,11 +323,11 @@
pass
else:
if item['action'] == 'cut':
- mover = zapi.getAdapter(obj, IObjectMover)
+ mover = IObjectMover(obj)
mover.moveTo(target)
moved = True
elif item['action'] == 'copy':
- copier = zapi.getAdapter(obj, IObjectCopier)
+ copier = IObjectCopier(obj)
copier.copyTo(target)
else:
raise
@@ -350,7 +350,7 @@
annotations = annotationsvc.getAnnotations(user)
# touch at least one item to in clipboard confirm contents
- clipboard = zapi.getAdapter(annotations, IPrincipalClipboard)
+ clipboard = IPrincipalClipboard(annotations)
items = clipboard.getContents()
for item in items:
try:
=== Zope3/src/zope/app/browser/container/find.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/container/find.py:1.7 Sun Sep 21 13:30:21 2003
+++ Zope3/src/zope/app/browser/container/find.py Sat Mar 6 11:50:12 2004
@@ -19,7 +19,7 @@
from zope.app.container.find import SimpleIdFindFilter
from zope.app.interfaces.find import IFind
from zope.app.traversing import getName
-from zope.component import getAdapter, getView
+from zope.component import getView
from zope.app.publisher.browser import BrowserView
# XXX very simple implementation right now
@@ -27,7 +27,7 @@
def findByIds(self, ids):
"""Do a find for the ids listed in ids, which is a string."""
- finder = getAdapter(self.context, IFind)
+ finder = IFind(self.context)
ids = ids.split()
# if we don't have any ids listed, don't search at all
if not ids:
More information about the Zope3-Checkins
mailing list