[Zope3-checkins] CVS: zopeproducts/photoslide - __init__.py:1.2
Bjorn Tillenius
bjoti777 at student.liu.se
Sun Sep 21 18:18:46 EDT 2003
Update of /cvs-repository/zopeproducts/photoslide
In directory cvs.zope.org:/tmp/cvs-serv27288
Modified Files:
__init__.py
Log Message:
Updated code to work after ParentGeddon and ReplaceSetObjectWithSetitem.
=== zopeproducts/photoslide/__init__.py 1.1 => 1.2 ===
--- zopeproducts/photoslide/__init__.py:1.1 Fri Aug 15 08:15:14 2003
+++ zopeproducts/photoslide/__init__.py Sun Sep 21 18:18:16 2003
@@ -19,7 +19,6 @@
from zope.app import zapi
from zope.app.container.btree import BTreeContainer
from zope.app.content.folder import Folder
-from zope.app.context import ContextWrapper
from zope.app.interfaces.file import IDirectoryFactory
from zope.interface import implements
@@ -44,12 +43,12 @@
self._title = title
self._positions = PersistentList()
- def setObject(self, key, object):
+ def __setitem__(self, key, object):
"""Needed in order to keep track of the positions of the photos."""
- name = super(PhotoSlide, self).setObject(key, object)
- if name not in self._positions:
- self._positions.append(name)
- return name
+ super(PhotoSlide, self).__setitem__(key, object)
+ if key not in self._positions:
+ self._positions.append(key)
+ return key
def __delitem__(self, key):
"""Needed in order to keep track of the positions of the photos."""
@@ -70,7 +69,7 @@
"""See IPhotoSlide."""
photos = []
for name in self._positions:
- photos.append(ContextWrapper(self[name], self))
+ photos.append(self[name])
return photos
More information about the Zope3-Checkins
mailing list