Skip to content

Commit

Permalink
Merged latest changes of the trunk to the branch. All tests pass and
Browse files Browse the repository at this point in the history
everything seems to be fine!
  • Loading branch information
strichter committed Feb 14, 2005
1 parent ddb8bc8 commit a213dd7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
9 changes: 5 additions & 4 deletions browser/contents.py
Expand Up @@ -16,7 +16,7 @@
$Id$
"""
__docformat__ = 'restructuredtext'

import urllib

from zope.app.traversing.interfaces import TraversalError
Expand All @@ -33,7 +33,7 @@
from zope.app.copypastemove.interfaces import IPrincipalClipboard
from zope.app.copypastemove.interfaces import IObjectCopier
from zope.app.copypastemove.interfaces import IObjectMover
from zope.app.copypastemove import rename
from zope.app.copypastemove.interfaces import IContainerItemRenamer
from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility

from zope.app.container.browser.adding import Adding
Expand Down Expand Up @@ -205,9 +205,10 @@ def renameObjects(self):
ids = request.get("rename_ids")
newids = request.get("new_value")

renamer = IContainerItemRenamer(self.context)
for oldid, newid in map(None, ids, newids):
if newid != oldid:
rename(self.context, oldid, newid)
renamer.renameItem(oldid, newid)

def changeTitle(self):
"""Given a sequence of tuples of old, new ids we rename"""
Expand Down Expand Up @@ -241,7 +242,7 @@ def addObject(self):
# above, because there is no "+" view.
adding.__parent__ = self.context
adding.__name__ = '+'

adding.action(request['type_name'], new)

def removeObjects(self):
Expand Down
21 changes: 14 additions & 7 deletions browser/tests/test_contents.py
Expand Up @@ -22,14 +22,17 @@
from zope.app.annotation.interfaces import IAnnotations
from zope.app.component.testing import PlacefulSetup
from zope.app.container.contained import contained
from zope.app.copypastemove import ContainerItemRenamer
from zope.app.copypastemove import ObjectMover, ObjectCopier
from zope.app.copypastemove import PrincipalClipboard
from zope.app.copypastemove.interfaces import IContainerItemRenamer
from zope.app.copypastemove.interfaces import IObjectMover, IObjectCopier
from zope.app.copypastemove.interfaces import IPrincipalClipboard
from zope.app.principalannotation import PrincipalAnnotationUtility
from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility
from zope.app.testing import ztapi
from zope.app.traversing.api import traverse
from zope.app.container.interfaces import IContainer, IContained


class BaseTestContentsBrowserView(PlacefulSetup):
Expand All @@ -45,9 +48,11 @@ class BaseTestContentsBrowserView(PlacefulSetup):
def setUp(self):
PlacefulSetup.setUp(self)
PlacefulSetup.buildFolders(self)

ztapi.provideAdapter(None, IObjectCopier, ObjectCopier)
ztapi.provideAdapter(None, IObjectMover, ObjectMover)

ztapi.provideAdapter(IContained, IObjectCopier, ObjectCopier)
ztapi.provideAdapter(IContained, IObjectMover, ObjectMover)
ztapi.provideAdapter(IContainer, IContainerItemRenamer,
ContainerItemRenamer)

ztapi.provideAdapter(IAnnotations, IPrincipalClipboard,
PrincipalClipboard)
Expand Down Expand Up @@ -83,7 +88,7 @@ def testInfoUnicode(self):
container = self._TestView__newContext()
subcontainer = self._TestView__newContext()
container[u'f\xf6\xf6'] = subcontainer

fc = self._TestView__newView(container)
info_list = fc.listContentInfo()

Expand Down Expand Up @@ -155,7 +160,7 @@ class Document(object):


class Principal(object):

id = 'bob'


Expand All @@ -164,8 +169,10 @@ class TestCutCopyPaste(PlacefulSetup, TestCase):
def setUp(self):
PlacefulSetup.setUp(self)
PlacefulSetup.buildFolders(self)
ztapi.provideAdapter(None, IObjectCopier, ObjectCopier)
ztapi.provideAdapter(None, IObjectMover, ObjectMover)
ztapi.provideAdapter(IContained, IObjectCopier, ObjectCopier)
ztapi.provideAdapter(IContained, IObjectMover, ObjectMover)
ztapi.provideAdapter(IContainer, IContainerItemRenamer,
ContainerItemRenamer)

ztapi.provideAdapter(IAnnotations, IPrincipalClipboard,
PrincipalClipboard)
Expand Down

0 comments on commit a213dd7

Please sign in to comment.