[Zope3-checkins] CVS: Zope3/src/zope/app/fssync -
committer.py:1.18.2.4
Jim Fulton
jim at zope.com
Fri Sep 12 15:15:56 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/fssync
In directory cvs.zope.org:/tmp/cvs-serv13470/src/zope/app/fssync
Modified Files:
Tag: parentgeddon-branch
committer.py
Log Message:
Can't have the tests passing, can we?
=== Zope3/src/zope/app/fssync/committer.py 1.18.2.3 => 1.18.2.4 ===
--- Zope3/src/zope/app/fssync/committer.py:1.18.2.3 Fri Sep 12 12:30:54 2003
+++ Zope3/src/zope/app/fssync/committer.py Fri Sep 12 15:15:25 2003
@@ -27,8 +27,9 @@
from zope.app import zapi
from zope.app.fssync import fspickle
-from zope.app.interfaces.container import IContainer, IRemoveSource, IAddTarget
+from zope.app.interfaces.container import IContainer
from zope.app.interfaces.fssync import IObjectDirectory, IObjectFile
+from zope.app.interfaces.container import IContainer
from zope.app.traversing import traverseName, getName
from zope.app.interfaces.file import IFileFactory, IDirectoryFactory
from zope.app.event import publish
@@ -395,26 +396,13 @@
if not replace:
publish(container, ObjectCreatedEvent(obj))
if replace:
- remover = zapi.getAdapter(container, IRemoveSource)
- remover.removeObject(name)
- adder = getAdapter(container, IAddTarget)
- newname = adder.addObject(name, obj)
- if newname != name:
- raise SynchronizationError(
- "Container generated new name for %s (new name %s)" %
- (name, newname))
- else:
- # Not a container, must be a mapping
- # (This is used for extras and annotations)
- container[name] = obj
+ del container[name]
+
+ container[name] = obj
def delete_item(container, name):
"""Helper to delete an item from a container or mapping."""
- if IContainer.isImplementedBy(container):
- remover = zapi.getAdapter(container, IRemoveSource)
- remover.removeObject(name)
- else:
- del container[name]
+ del container[name]
def read_file(fspath):
"""Helper to read the data from a file."""
More information about the Zope3-Checkins
mailing list