[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ Moved the code from
zope.app.traversing.__init__.py to
Jim Fulton
jim at zope.com
Tue May 25 13:27:47 EDT 2004
Log message for revision 24964:
Moved the code from zope.app.traversing.__init__.py to
zope.app.traversing.api to avoid a common source of circular import
problems.
I'll note:
- We really need a tool for detecting circular imports. If I had such
a tool, I would try hard to eliminate them. They are like land
mines.
- Fat __init__.py files tend to produce circular imports.
It's useful to have thin __init__.py files that import names for
convenience, but this needs to be done with great care.
- I bet most uses of zope.app.traverse.api.traverse can go away
now, since we don't care about context wrappers any more.
- I suspect that a lot of the path-manipulation calls can go away
as we absorb the impacts of last summer's parentgeddon.
- Most of places that import zope.app.traverse.api should probably
be converted to use zapi.
-=-
Modified: Zope3/trunk/src/zope/app/appsetup/bootstrap.py
===================================================================
--- Zope3/trunk/src/zope/app/appsetup/bootstrap.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/appsetup/bootstrap.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -27,7 +27,7 @@
from zope.app import zapi
from zope.app.event.interfaces import ISubscriber
-from zope.app.traversing import traverse, traverseName
+from zope.app.traversing.api import traverse, traverseName
from zope.app.publication.zopepublication import ZopePublication
from zope.app.folder import rootFolder
from zope.app.servicenames import HubIds, PrincipalAnnotation
Modified: Zope3/trunk/src/zope/app/appsetup/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/appsetup/tests.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/appsetup/tests.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -30,7 +30,7 @@
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.app.errorservice import ErrorReportingService
from zope.app.servicenames import ErrorLogging
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.site.service import ServiceManager
class EventStub(object):
Modified: Zope3/trunk/src/zope/app/component/hooks.py
===================================================================
--- Zope3/trunk/src/zope/app/component/hooks.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/component/hooks.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -24,7 +24,7 @@
from zope.component.exceptions import ComponentLookupError
from zope.proxy import removeAllProxies
from zope.security.proxy import trustedRemoveSecurityProxy
-from zope.app.traversing import IContainmentRoot
+from zope.app.traversing.interfaces import IContainmentRoot
from zope.app.location.interfaces import ILocation
from zope.app.location import locate
from zope.component.servicenames import Presentation
Modified: Zope3/trunk/src/zope/app/component/tests/test_localservice.py
===================================================================
--- Zope3/trunk/src/zope/app/component/tests/test_localservice.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/component/tests/test_localservice.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -20,7 +20,7 @@
from zope.app.component.hooks import getServices_hook
from zope.app.component.localservice import serviceServiceAdapter
from zope.app.site.interfaces import IPossibleSite, ISite, ISiteManager
-from zope.app.traversing import IContainmentRoot
+from zope.app.traversing.interfaces import IContainmentRoot
from zope.component.exceptions import ComponentLookupError
from zope.component.interfaces import IServiceService
from zope.component.service import serviceManager
Modified: Zope3/trunk/src/zope/app/container/browser/find.py
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/find.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/container/browser/find.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -18,7 +18,7 @@
# XXX this needs to be looked up in a registry
from zope.app.container.find import SimpleIdFindFilter
from zope.app.container.interfaces import IFind
-from zope.app.traversing import getName
+from zope.app.traversing.api import getName
from zope.component import getView
from zope.app.publisher.browser import BrowserView
Modified: Zope3/trunk/src/zope/app/container/browser/tests/test_contents.py
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/tests/test_contents.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/container/browser/tests/test_contents.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -21,7 +21,7 @@
from zope.app.copypastemove.interfaces import IObjectMover
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.copypastemove.interfaces import IObjectMover, IObjectCopier
from zope.app.copypastemove import ObjectMover, ObjectCopier
Modified: Zope3/trunk/src/zope/app/container/tests/test_objectcopier.py
===================================================================
--- Zope3/trunk/src/zope/app/container/tests/test_objectcopier.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/container/tests/test_objectcopier.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -18,7 +18,7 @@
"""
from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.app.tests import ztapi
from zope.app.copypastemove.interfaces import IObjectCopier
Modified: Zope3/trunk/src/zope/app/container/tests/test_objectmover.py
===================================================================
--- Zope3/trunk/src/zope/app/container/tests/test_objectmover.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/container/tests/test_objectmover.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -17,7 +17,7 @@
from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.app.tests import ztapi
from zope.app.copypastemove.interfaces import IObjectMover
Modified: Zope3/trunk/src/zope/app/copypastemove/tests/test_rename.py
===================================================================
--- Zope3/trunk/src/zope/app/copypastemove/tests/test_rename.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/copypastemove/tests/test_rename.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -21,7 +21,7 @@
from zope.app.tests import ztapi
from zope.exceptions import NotFoundError, DuplicationError
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.app.container.interfaces import IContainer
from zope.app.copypastemove.interfaces import IObjectMover
Modified: Zope3/trunk/src/zope/app/dav/ftests/test_propfind.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/ftests/test_propfind.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/dav/ftests/test_propfind.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -23,7 +23,7 @@
from zope.app import zapi
from zope.app.dav.ftests.dav import DAVTestCase
from zope.app.dublincore.interfaces import IZopeDublinCore
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
class TestPROPFIND(DAVTestCase):
Modified: Zope3/trunk/src/zope/app/dav/tests/test_mkcol.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/tests/test_mkcol.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/dav/tests/test_mkcol.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -19,7 +19,7 @@
from unittest import TestCase, TestSuite, main, makeSuite
from zope.app.tests import ztapi
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.app.container.interfaces import IWriteContainer
Modified: Zope3/trunk/src/zope/app/dav/tests/test_propfind.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/tests/test_propfind.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/dav/tests/test_propfind.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -28,7 +28,7 @@
from zope.app import zapi
from zope.app.tests import ztapi
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.publisher.browser import TestRequest
from zope.app.filerepresentation.interfaces import IWriteFile
from zope.app.site.tests.placefulsetup import PlacefulSetup
Modified: Zope3/trunk/src/zope/app/dependable/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/dependable/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/dependable/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -19,7 +19,7 @@
from interfaces import IDependable
from zope.app.annotation.interfaces import IAnnotations
-from zope.app.traversing import getParent, canonicalPath, getPath
+from zope.app.traversing.api import getParent, canonicalPath, getPath
from zope.interface import implements
Modified: Zope3/trunk/src/zope/app/event/subs.py
===================================================================
--- Zope3/trunk/src/zope/app/event/subs.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/event/subs.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -23,8 +23,8 @@
from zope.proxy import removeAllProxies
-from zope.app.traversing import getPath
-from zope.app.traversing import canonicalPath, traverse
+from zope.app.traversing.api import getPath
+from zope.app.traversing.api import canonicalPath, traverse
from zope.app.event.interfaces import IEvent, ISubscriber, ISubscribable
from zope.app.event.interfaces import ISubscribingAware
Modified: Zope3/trunk/src/zope/app/event/tests/test_localservice.py
===================================================================
--- Zope3/trunk/src/zope/app/event/tests/test_localservice.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/event/tests/test_localservice.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -32,7 +32,7 @@
from zope.app.event.objectevent import ObjectModifiedEvent
from zope.app.event.interfaces import IEvent, ISubscriber, ISubscribingAware
-from zope.app.traversing import getPath, traverse
+from zope.app.traversing.api import getPath, traverse
from zope.app.traversing.interfaces import IContainmentRoot
from zope.app.container.interfaces import IObjectAddedEvent, IObjectRemovedEvent
from zope.app.container.contained import ObjectAddedEvent, Contained
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -26,7 +26,7 @@
from zope.app.form.browser import CheckBoxWidget
from support import *
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.tests.functional import BrowserTestCase
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -28,7 +28,7 @@
from zope.schema import Datetime, Choice
from support import *
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.tests.functional import BrowserTestCase
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -30,7 +30,7 @@
from zope.app.form.browser.textwidgets import FileWidget
from support import *
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.tests.functional import BrowserTestCase
from zope.app.form.interfaces import IInputWidget
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -27,7 +27,7 @@
from zope.schema import Float, Choice
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.tests.functional import BrowserTestCase
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -26,7 +26,7 @@
from zope.schema import Int, Choice
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.tests.functional import BrowserTestCase
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -26,7 +26,7 @@
from zope.schema import Text
from support import *
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.tests.functional import BrowserTestCase
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -23,7 +23,7 @@
from zope.schema import TextLine, Choice
from support import *
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.tests.functional import BrowserTestCase
Modified: Zope3/trunk/src/zope/app/fssync/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/fssync/browser/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/fssync/browser/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -23,7 +23,7 @@
from transaction import get_transaction
from zope.app.publisher.browser import BrowserView
-from zope.app.traversing import getName, getParent, getRoot
+from zope.app.traversing.api import getName, getParent, getRoot
from zope.fssync.snarf import Snarfer, Unsnarfer
from zope.app.fssync import syncer
from zope.app.fssync.committer import Committer, Checker
Modified: Zope3/trunk/src/zope/app/fssync/committer.py
===================================================================
--- Zope3/trunk/src/zope/app/fssync/committer.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/fssync/committer.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -29,7 +29,7 @@
from zope.app.fssync import fspickle
from zope.app.container.interfaces import IContainer
from zope.app.container.interfaces import IContainer
-from zope.app.traversing import traverseName, getName
+from zope.app.traversing.api import traverseName, getName
from zope.app.filerepresentation.interfaces import IFileFactory
from zope.app.filerepresentation.interfaces import IDirectoryFactory
from zope.app.event import publish
Modified: Zope3/trunk/src/zope/app/fssync/syncer.py
===================================================================
--- Zope3/trunk/src/zope/app/fssync/syncer.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/fssync/syncer.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -20,7 +20,7 @@
from zope.fssync.server.syncer import Syncer
from zope.app.annotation.interfaces import IAnnotations
-from zope.app.traversing import getPath
+from zope.app.traversing.api import getPath
def getObjectId(obj):
Modified: Zope3/trunk/src/zope/app/hub/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/hub/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/hub/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -50,7 +50,7 @@
from zope.app.event.localservice import ServiceSubscriberEventChannel
from zope.app.servicenames import HubIds
-from zope.app.traversing \
+from zope.app.traversing.api \
import getPath, canonicalPath, traverse, traverseName, getRoot
from persistent import Persistent
from zope.app.container.contained import Contained
Modified: Zope3/trunk/src/zope/app/hub/tests/objecthubsetup.py
===================================================================
--- Zope3/trunk/src/zope/app/hub/tests/objecthubsetup.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/hub/tests/objecthubsetup.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -17,7 +17,7 @@
from zope.app import zapi
from zope.app.event.tests.eventsetup import EventSetup
from zope.app.servicenames import HubIds
-from zope.app.traversing import traverse, canonicalPath
+from zope.app.traversing.api import traverse, canonicalPath
from zope.app.container.interfaces import IObjectAddedEvent, IObjectMovedEvent
from zope.app.event.interfaces import ISubscriber
Modified: Zope3/trunk/src/zope/app/hub/tests/test_hookedhubevent.py
===================================================================
--- Zope3/trunk/src/zope/app/hub/tests/test_hookedhubevent.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/hub/tests/test_hookedhubevent.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -23,7 +23,7 @@
from zope.app.hub import \
ObjectRegisteredHubEvent, ObjectUnregisteredHubEvent, \
ObjectModifiedHubEvent, ObjectMovedHubEvent, ObjectRemovedHubEvent
-from zope.app.traversing import getPath
+from zope.app.traversing.api import getPath
class AbstractTestHubEvent(ObjectHubSetup, unittest.TestCase):
Modified: Zope3/trunk/src/zope/app/hub/tests/test_objecthub.py
===================================================================
--- Zope3/trunk/src/zope/app/hub/tests/test_objecthub.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/hub/tests/test_objecthub.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -46,7 +46,7 @@
from zope.exceptions import NotFoundError
-from zope.app.traversing import canonicalPath, traverse
+from zope.app.traversing.api import canonicalPath, traverse
from zope.interface import implements, directlyProvides
Modified: Zope3/trunk/src/zope/app/hub/tests/test_registration.py
===================================================================
--- Zope3/trunk/src/zope/app/hub/tests/test_registration.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/hub/tests/test_registration.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -18,7 +18,7 @@
from zope.app import zapi
from zope.app.hub import Registration
from zope.app.site.tests.placefulsetup import PlacefulSetup
-from zope.app.traversing import traverse, canonicalPath
+from zope.app.traversing.api import traverse, canonicalPath
from zope.app.container.contained import ObjectAddedEvent
from zope.component import getService
from zope.app.servicenames import EventPublication, HubIds
Modified: Zope3/trunk/src/zope/app/index/browser/field/control.py
===================================================================
--- Zope3/trunk/src/zope/app/index/browser/field/control.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/index/browser/field/control.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -19,7 +19,7 @@
from zope.app.dublincore.interfaces import IZopeDublinCore
from zope.app.index.interfaces.text import IQueryView
from zope.app.servicenames import HubIds
-from zope.app.traversing import canonicalPath
+from zope.app.traversing.api import canonicalPath
from zope.component import getService, queryAdapter
from zope.exceptions import NotFoundError
from zope.interface import implements
Modified: Zope3/trunk/src/zope/app/index/browser/text/control.py
===================================================================
--- Zope3/trunk/src/zope/app/index/browser/text/control.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/index/browser/text/control.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -21,7 +21,7 @@
from zope.exceptions import NotFoundError
from zope.app.publisher.browser import BrowserView
-from zope.app.traversing import canonicalPath
+from zope.app.traversing.api import canonicalPath
from zope.app.dublincore.interfaces import IZopeDublinCore
from zope.app.index.interfaces.text import IQueryView
Modified: Zope3/trunk/src/zope/app/index/field/tests/test_index.py
===================================================================
--- Zope3/trunk/src/zope/app/index/field/tests/test_index.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/index/field/tests/test_index.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -21,7 +21,7 @@
from zope.interface.verify import verifyObject
from zope.app.event.objectevent import ObjectModifiedEvent
from zope.app.site.tests.placefulsetup import PlacefulSetup
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.component import getService
from zope.app.tests import ztapi
from zope.app.servicenames import HubIds
Modified: Zope3/trunk/src/zope/app/index/text/tests/test_index.py
===================================================================
--- Zope3/trunk/src/zope/app/index/text/tests/test_index.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/index/text/tests/test_index.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -20,7 +20,7 @@
from zope.app.event.objectevent import ObjectModifiedEvent
from zope.app.site.tests.placefulsetup import PlacefulSetup
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.component import getService
from zope.app.servicenames import HubIds
from zope.app.hub.interfaces import \
Modified: Zope3/trunk/src/zope/app/location/traversing.py
===================================================================
--- Zope3/trunk/src/zope/app/location/traversing.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/location/traversing.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -20,7 +20,7 @@
from zope.app.traversing.interfaces import IContainmentRoot
from zope.app.traversing.interfaces import ITraverser
from zope.app.site.interfaces import ISite
-from zope.app.traversing import getParents
+from zope.app.traversing.api import getParents
from zope.app.location.location import Location
Modified: Zope3/trunk/src/zope/app/module/tests/test_module.py
===================================================================
--- Zope3/trunk/src/zope/app/module/tests/test_module.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/module/tests/test_module.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -19,7 +19,7 @@
from zope.interface import Interface, implements
from zope.app.site.tests.placefulsetup import PlacefulSetup
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.module import Manager
from ZODB.tests.util import DB
from transaction import get_transaction
Modified: Zope3/trunk/src/zope/app/onlinehelp/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/onlinehelp/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/onlinehelp/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -24,7 +24,7 @@
from zope.app import zapi
from zope.app.container.sample import SampleContainer
from zope.app.traversing.interfaces import IContainmentRoot
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.onlinehelp.interfaces import IOnlineHelpTopic, IOnlineHelp
from zope.interface import implements
Modified: Zope3/trunk/src/zope/app/pluggableauth/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/pluggableauth/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/pluggableauth/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -32,7 +32,7 @@
from zope.app import zapi
from zope.app.location import locate
-from zope.app.traversing import getPath
+from zope.app.traversing.api import getPath
from zope.app.container.interfaces import IOrderedContainer
from zope.app.container.interfaces import IContainerNamesContainer, INameChooser
Modified: Zope3/trunk/src/zope/app/presentation/pagefolder.py
===================================================================
--- Zope3/trunk/src/zope/app/presentation/pagefolder.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/presentation/pagefolder.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -34,7 +34,7 @@
from zope.app.registration.registration import RegisterableContainer
from zope.app.container.constraints import ContainerTypesConstraint
from zpt import IZPTTemplate
-from zope.app.traversing import getPath
+from zope.app.traversing.api import getPath
from zope.proxy import removeAllProxies
from zope.publisher.interfaces.browser import IBrowserRequest
Modified: Zope3/trunk/src/zope/app/presentation/tests/test_presentation.py
===================================================================
--- Zope3/trunk/src/zope/app/presentation/tests/test_presentation.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/presentation/tests/test_presentation.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -41,7 +41,7 @@
from zope.app.presentation.presentation import PageRegistrationAddSubscriber
from zope.app.presentation.presentation import PageRegistrationRemoveSubscriber
from zope.app.tests import setup
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.component.exceptions import ComponentLookupError
from zope.component.interfaces import IServiceService
Modified: Zope3/trunk/src/zope/app/registration/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/registration/browser/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/registration/browser/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -27,7 +27,7 @@
from zope.app.registration.interfaces import IRegistration
from zope.app.registration.interfaces import RegisteredStatus
from zope.app.registration.interfaces import UnregisteredStatus
-from zope.app.traversing import getName, traverse
+from zope.app.traversing.api import getName, traverse
from zope.component import getView, getServices
from zope.interface import implements
from zope.proxy import removeAllProxies
Modified: Zope3/trunk/src/zope/app/registration/tests/test_registrationmanager.py
===================================================================
--- Zope3/trunk/src/zope/app/registration/tests/test_registrationmanager.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/registration/tests/test_registrationmanager.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -21,7 +21,7 @@
from zope.app.registration.registration import RegistrationManagerRemoveSubscriber
from zope.app.site.tests import placefulsetup
from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.interface.common.tests.basemapping import BaseTestIEnumerableMapping
from zope.interface.verify import verifyObject
from zope.interface import implements
Modified: Zope3/trunk/src/zope/app/registration/tests/test_registrations.py
===================================================================
--- Zope3/trunk/src/zope/app/registration/tests/test_registrations.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/registration/tests/test_registrations.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -28,7 +28,7 @@
SimpleRegistration, ComponentRegistration
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.app.dependable.interfaces import IDependable
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.security.proxy import Proxy
from zope.app.container.contained import ObjectRemovedEvent
from zope.app.tests import ztapi
Modified: Zope3/trunk/src/zope/app/registration/tests/test_registrationstack.py
===================================================================
--- Zope3/trunk/src/zope/app/registration/tests/test_registrationstack.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/registration/tests/test_registrationstack.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -18,7 +18,7 @@
from unittest import TestCase, TestSuite, main, makeSuite
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.app.registration.registration import RegistrationStack
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
class Registration:
Modified: Zope3/trunk/src/zope/app/rotterdam/tests/test_xmlnavigationviews.py
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/tests/test_xmlnavigationviews.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/rotterdam/tests/test_xmlnavigationviews.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -22,7 +22,7 @@
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.app.tests import ztapi
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.event.tests.eventsetup import EventSetup
from zope.app.container.interfaces import IReadContainer
Modified: Zope3/trunk/src/zope/app/rotterdam/xmlobject.py
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/xmlobject.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/rotterdam/xmlobject.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -19,7 +19,7 @@
from zope.app.publisher.browser import BrowserView
from zope.app import zapi
from zope.app.container.interfaces import IReadContainer
-from zope.app.traversing import getParents, getParent, traverse
+from zope.app.traversing.api import getParents, getParent, traverse
from zope.interface import Interface
from rfc822 import formatdate, time
from xml.sax.saxutils import quoteattr
Modified: Zope3/trunk/src/zope/app/schema/tests/test_interfaceutility.py
===================================================================
--- Zope3/trunk/src/zope/app/schema/tests/test_interfaceutility.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/schema/tests/test_interfaceutility.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -26,7 +26,7 @@
from zope.app.container.contained import Contained
from zope.component import getService
from zope.component.exceptions import ComponentLookupError
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.registration.interfaces import IRegistrationStack
from zope.app.registration.interfaces import UnregisteredStatus
from zope.app.registration.interfaces import RegisteredStatus
Modified: Zope3/trunk/src/zope/app/site/folder.py
===================================================================
--- Zope3/trunk/src/zope/app/site/folder.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/site/folder.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -19,7 +19,7 @@
from zope.app.container.btree import BTreeContainer
from zope.app.filerepresentation.interfaces import IDirectoryFactory
from zope.app.registration.registration import RegisterableContainer
-from zope.app.traversing import getPath
+from zope.app.traversing.api import getPath
from zope.app.container.contained import setitem
from zope.app.site.interfaces import ISiteManagementFolders
Modified: Zope3/trunk/src/zope/app/site/service.py
===================================================================
--- Zope3/trunk/src/zope/app/site/service.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/site/service.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -45,7 +45,7 @@
from zope.app.event.function import Subscriber
from zope.app.registration.interfaces import IRegistry
from zope.app.traversing.interfaces import IContainmentRoot
-from zope.app.traversing import getPath
+from zope.app.traversing.api import getPath
from zope.app.location import inside
from zope.app.site.folder import SiteManagementFolder
from zope.app.registration.registration import ComponentRegistration
Modified: Zope3/trunk/src/zope/app/site/tests/test_servicemanager.py
===================================================================
--- Zope3/trunk/src/zope/app/site/tests/test_servicemanager.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/site/tests/test_servicemanager.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -23,7 +23,7 @@
from zope.app.site.service import ServiceManager, ServiceRegistration
from zope.component import getService, getServices, getGlobalServices
from zope.app.site.tests.placefulsetup import PlacefulSetup
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.registration.interfaces import UnregisteredStatus
from zope.app.registration.interfaces import ActiveStatus
from zope.app.registration.interfaces import RegisteredStatus
Modified: Zope3/trunk/src/zope/app/site/tests/test_serviceregistration.py
===================================================================
--- Zope3/trunk/src/zope/app/site/tests/test_serviceregistration.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/site/tests/test_serviceregistration.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -20,7 +20,7 @@
from zope.interface import Interface, implements
-from zope.app.traversing import traverse, getPath
+from zope.app.traversing.api import traverse, getPath
from zope.app.site.service import ServiceRegistration
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.component.service import defineService
Deleted: Zope3/trunk/src/zope/app/traversing/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/traversing/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/traversing/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -1,224 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-Convenience functions for traversing the object tree.
-
-$Id$
-"""
-
-from zope.interface import moduleProvides
-from interfaces import IContainmentRoot, ITraversalAPI
-from interfaces import ITraverser, IPhysicallyLocatable
-
-moduleProvides(ITraversalAPI)
-__all__ = tuple(ITraversalAPI)
-
-_marker = object()
-
-def joinPath(path, *args):
- """Join the given relative paths to the given path.
-
- Returns a unicode path.
-
- The path should be well-formed, and not end in a '/' unless it is
- the root path. It can be either a string (ascii only) or unicode.
- The positional arguments are relative paths to be added to the
- path as new path segments. The path may be absolute or relative.
-
- A segment may not start with a '/' because that would be confused
- with an absolute path. A segment may not end with a '/' because we
- do not allow '/' at the end of relative paths. A segment may
- consist of . or .. to mean "the same place", or "the parent path"
- respectively. A '.' should be removed and a '..' should cause the
- segment to the left to be removed. joinPath('/', '..') should
- raise an exception.
- """
-
- if not args:
- # Concatenating u'' is much quicker than unicode(path)
- return u'' + path
- if path != '/' and path.endswith('/'):
- raise ValueError('path must not end with a "/": %s' % path)
- if path != '/':
- path += u'/'
- for arg in args:
- if arg.startswith('/') or arg.endswith('/'):
- raise ValueError("Leading or trailing slashes in path elements")
- return _normalizePath(path + u'/'.join(args))
-
-def getPath(obj):
- """Returns a string representing the physical path to the object.
- """
- return IPhysicallyLocatable(obj).getPath()
-
-def getRoot(obj):
- """Returns the root of the traversal for the given object.
- """
- return IPhysicallyLocatable(obj).getRoot()
-
-def traverse(object, path, default=_marker, request=None):
- """Traverse 'path' relative to the given object.
-
- 'path' is a string with path segments separated by '/'.
-
- 'request' is passed in when traversing from presentation code. This
- allows paths like @@foo to work.
-
- Raises NotFoundError if path cannot be found
- Raises TypeError if place is not context wrapped
-
- Note: calling traverse with a path argument taken from an untrusted
- source, such as an HTTP request form variable, is a bad idea.
- It could allow a maliciously constructed request to call
- code unexpectedly.
- Consider using traverseName instead.
- """
- traverser = ITraverser(object)
- if default is _marker:
- return traverser.traverse(path, request=request)
- else:
- return traverser.traverse(path, default=default, request=request)
-
-def traverseName(obj, name, default=_marker, traversable=None, request=None):
- """Traverse a single step 'name' relative to the given object.
-
- 'name' must be a string. '.' and '..' are treated specially, as well as
- names starting with '@' or '+'. Otherwise 'name' will be treated as a
- single path segment.
-
- You can explicitly pass in an ITraversable as the 'traversable'
- argument. If you do not, the given object will be adapted to ITraversable.
-
- 'request' is passed in when traversing from presentation code. This
- allows paths like @@foo to work.
-
- Raises NotFoundError if path cannot be found and 'default' was not provided.
- """
- further_path = []
- if default is _marker:
- obj = traversePathElement(obj, name, further_path,
- traversable=traversable, request=request)
- else:
- obj = traversePathElement(obj, name, further_path, default=default,
- traversable=traversable, request=request)
- if further_path:
- raise NotImplementedError('further_path returned from traverse')
- else:
- return obj
-
-def getName(obj):
- """Get the name an object was traversed via
- """
- return IPhysicallyLocatable(obj).getName()
-
-def getParent(obj):
- """Returns the container the object was traversed via.
-
- Returns None if the object is a containment root.
- Raises TypeError if the object doesn't have enough context to get the
- parent.
- """
-
- if IContainmentRoot.providedBy(obj):
- return None
-
- parent = getattr(obj, '__parent__', None)
- if parent is not None:
- return parent
-
- raise TypeError("Not enough context information to get parent", obj)
-
-
-
-def getParents(obj):
- """Returns a list starting with the given object's parent followed by
- each of its parents.
-
- Raises a TypeError if the context doesn't go all the way down to
- a containment root.
- """
- if IContainmentRoot.providedBy(obj):
- return []
-
-
- parents = []
- w = obj
- while 1:
- w = w.__parent__
- if w is None:
- break
- parents.append(w)
-
- if parents and IContainmentRoot.providedBy(parents[-1]):
- return parents
-
- raise TypeError, "Not enough context information to get all parents"
-
-
-def _normalizePath(path):
- """Normalize a path by resolving '.' and '..' path elements."""
-
- # Special case for the root path.
- if path == u'/':
- return path
-
- new_segments = []
- prefix = u''
- if path.startswith('/'):
- prefix = u'/'
- path = path[1:]
-
- for segment in path.split(u'/'):
- if segment == u'.':
- continue
- if segment == u'..':
- new_segments.pop() # raises IndexError if there is nothing to pop
- continue
- if not segment:
- raise ValueError('path must not contain empty segments: %s'
- % path)
- new_segments.append(segment)
-
- return prefix + u'/'.join(new_segments)
-
-def canonicalPath(path_or_object):
- """Returns a canonical absolute unicode path for the given path or object.
-
- Resolves segments that are '.' or '..'.
-
- Raises ValueError if a badly formed path is given.
- """
- if isinstance(path_or_object, (str, unicode)):
- path = path_or_object
- if not path:
- raise ValueError("path must be non-empty: %s" % path)
- else:
- path = getPath(path_or_object)
-
- path = u'' + path
-
- # Special case for the root path.
- if path == u'/':
- return path
-
- if path[0] != u'/':
- raise ValueError('canonical path must start with a "/": %s' % path)
- if path[-1] == u'/':
- raise ValueError('path must not end with a "/": %s' % path)
-
- # Break path into segments. Process '.' and '..' segments.
- return _normalizePath(path)
-
-# import this down here to avoid circular imports
-from zope.app.traversing.adapters import traversePathElement
Added: Zope3/trunk/src/zope/app/traversing/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/traversing/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/traversing/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -0,0 +1 @@
+#
Property changes on: Zope3/trunk/src/zope/app/traversing/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Copied: Zope3/trunk/src/zope/app/traversing/api.py (from rev 24955, Zope3/trunk/src/zope/app/traversing/__init__.py)
Modified: Zope3/trunk/src/zope/app/traversing/ftests/test_vhosting.py
===================================================================
--- Zope3/trunk/src/zope/app/traversing/ftests/test_vhosting.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/traversing/ftests/test_vhosting.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -22,7 +22,7 @@
from zope.app.folder import Folder
from transaction import get_transaction
from zope.app.publisher.browser.resource import Resource
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.security.checker import defineChecker, NoProxy
from zope.app.container.contained import Contained
from zope.app.zptpage.zptpage import ZPTPage
Modified: Zope3/trunk/src/zope/app/traversing/tests/test_conveniencefunctions.py
===================================================================
--- Zope3/trunk/src/zope/app/traversing/tests/test_conveniencefunctions.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/traversing/tests/test_conveniencefunctions.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -79,14 +79,14 @@
IContainmentRoot, IPhysicallyLocatable, RootPhysicallyLocatable)
def testTraverse(self):
- from zope.app.traversing import traverse
+ from zope.app.traversing.api import traverse
self.assertEqual(
traverse(self.item, '/folder/item'),
self.tr.traverse('/folder/item')
)
def testTraverseFromUnwrapped(self):
- from zope.app.traversing import traverse
+ from zope.app.traversing.api import traverse
self.assertRaises(
TypeError,
traverse,
@@ -94,7 +94,7 @@
)
def testTraverseName(self):
- from zope.app.traversing import traverseName
+ from zope.app.traversing.api import traverseName
self.assertEqual(
traverseName(self.folder, 'item'),
self.tr.traverse('/folder/item')
@@ -111,7 +111,7 @@
# XXX test that ++names++ and @@names work too
def testTraverseNameBadValue(self):
- from zope.app.traversing import traverseName
+ from zope.app.traversing.api import traverseName
self.assertRaises(
NotFoundError,
traverseName,
@@ -129,28 +129,28 @@
)
def testGetName(self):
- from zope.app.traversing import getName
+ from zope.app.traversing.api import getName
self.assertEqual(
getName(self.item),
'item'
)
def testGetParent(self):
- from zope.app.traversing import getParent
+ from zope.app.traversing.api import getParent
self.assertEqual(
getParent(self.item),
self.folder
)
def testGetParentFromRoot(self):
- from zope.app.traversing import getParent
+ from zope.app.traversing.api import getParent
self.assertEqual(
getParent(self.root),
None
)
def testGetParentBrokenChain(self):
- from zope.app.traversing import getParent
+ from zope.app.traversing.api import getParent
self.assertRaises(
TypeError,
getParent,
@@ -158,7 +158,7 @@
)
def testGetParentFromUnwrapped(self):
- from zope.app.traversing import getParent
+ from zope.app.traversing.api import getParent
self.assertRaises(
TypeError,
getParent,
@@ -166,14 +166,14 @@
)
def testGetParents(self):
- from zope.app.traversing import getParents
+ from zope.app.traversing.api import getParents
self.assertEqual(
getParents(self.item),
[self.folder, self.root]
)
def testGetParentsBrokenChain(self):
- from zope.app.traversing import getParents
+ from zope.app.traversing.api import getParents
self.assertRaises(
TypeError,
getParents,
@@ -181,7 +181,7 @@
)
def testGetParentFromUnwrapped(self):
- from zope.app.traversing import getParent
+ from zope.app.traversing.api import getParent
self.assertRaises(
TypeError,
getParent,
@@ -189,28 +189,28 @@
)
def testGetPath(self):
- from zope.app.traversing import getPath
+ from zope.app.traversing.api import getPath
self.assertEqual(
getPath(self.item),
u'/folder/item'
)
def testGetPathOfRoot(self):
- from zope.app.traversing import getPath
+ from zope.app.traversing.api import getPath
self.assertEqual(
getPath(self.root),
u'/',
)
def testGetNameOfRoot(self):
- from zope.app.traversing import getName
+ from zope.app.traversing.api import getName
self.assertEqual(
getName(self.root),
u'',
)
def testGetRoot(self):
- from zope.app.traversing import getRoot
+ from zope.app.traversing.api import getRoot
self.assertEqual(
getRoot(self.item),
self.root
@@ -258,7 +258,7 @@
),
)
- from zope.app.traversing import canonicalPath
+ from zope.app.traversing.api import canonicalPath
for error_type, value in _bad_locations:
self.assertRaises(error_type, canonicalPath, value)
@@ -310,7 +310,7 @@
)
- from zope.app.traversing import _normalizePath
+ from zope.app.traversing.api import _normalizePath
for error_type, value in _bad_locations:
self.assertRaises(error_type, _normalizePath, value)
@@ -322,7 +322,7 @@
"failure on %s" % argument)
def test_joinPath_slashes(self):
- from zope.app.traversing import joinPath
+ from zope.app.traversing.api import joinPath
path = u'/'
args = ('/test', 'bla', '/foo', 'bar')
self.assertRaises(ValueError, joinPath, path, *args)
@@ -331,7 +331,7 @@
self.assertRaises(ValueError, joinPath, path, *args)
def test_joinPath(self):
- from zope.app.traversing import joinPath
+ from zope.app.traversing.api import joinPath
path = u'/bla'
args = ('foo', 'bar', 'baz', 'bone')
self.assertEqual(joinPath(path, *args), u'/bla/foo/bar/baz/bone')
@@ -349,7 +349,7 @@
self.assertRaises(ValueError, joinPath, path, *args)
def test_joinPath_normalize(self):
- from zope.app.traversing import joinPath
+ from zope.app.traversing.api import joinPath
path = u'/bla'
args = ('foo', 'bar', '..', 'baz', 'bone')
self.assertEqual(joinPath(path, *args), u'/bla/foo/baz/bone')
Modified: Zope3/trunk/src/zope/app/utility/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/utility/tests.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/utility/tests.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -23,7 +23,7 @@
from zope.interface import Interface, implements
from zope.component import getService
from zope.component.exceptions import ComponentLookupError
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.registration.interfaces import IRegistrationStack
from zope.app.registration.interfaces import UnregisteredStatus
from zope.app.registration.interfaces import RegisteredStatus
Modified: Zope3/trunk/src/zope/app/wiki/browser/wiki.py
===================================================================
--- Zope3/trunk/src/zope/app/wiki/browser/wiki.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/wiki/browser/wiki.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -21,7 +21,7 @@
from zope.app import zapi
from zope.app.dublincore.interfaces import ICMFDublinCore
from zope.app.servicenames import HubIds
-from zope.app.traversing import getName, getPath
+from zope.app.traversing.api import getName, getPath
from zope.app.container.browser.adding import Adding
from zope.app.hub import Registration
Modified: Zope3/trunk/src/zope/app/wiki/browser/wikipage.py
===================================================================
--- Zope3/trunk/src/zope/app/wiki/browser/wikipage.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/wiki/browser/wikipage.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -25,7 +25,7 @@
from zope.app import zapi
from zope.app.form.browser.submit import Update
from zope.app.dublincore.interfaces import ICMFDublinCore
-from zope.app.traversing import getParent, getPath, getName
+from zope.app.traversing.api import getParent, getPath, getName
from zope.app.wiki.interfaces import IWikiPageHierarchy, IMailSubscriptions
urlchars = r'[A-Za-z0-9/:@_%~#=&\.\-\?\+\$,]+'
Modified: Zope3/trunk/src/zope/app/wiki/traversal.py
===================================================================
--- Zope3/trunk/src/zope/app/wiki/traversal.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/wiki/traversal.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -19,7 +19,7 @@
from zope.publisher.interfaces import IPublishTraverse
from zope.exceptions import NotFoundError
-from zope.app.traversing import getParent
+from zope.app.traversing.api import getParent
from zope.app.traversing.namespace import UnexpectedParameters
from zope.app.traversing.interfaces import ITraversable
from zope.app.wiki.interfaces import IWikiPage
Modified: Zope3/trunk/src/zope/app/workflow/browser/definition.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/browser/definition.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/workflow/browser/definition.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -16,7 +16,7 @@
$Id$
"""
from zope.app import zapi
-from zope.app.traversing import traverse
+from zope.app.traversing.api import traverse
from zope.app.registration.interfaces import IRegistered
from zope.app.workflow.interfaces import IProcessDefinitionImportHandler
from zope.app.workflow.interfaces import IProcessDefinitionExportHandler
Modified: Zope3/trunk/src/zope/app/workflow/stateful/instance.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/stateful/instance.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/workflow/stateful/instance.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -30,7 +30,7 @@
from zope.app.workflow.stateful.interfaces import IBeforeRelevantDataChangeEvent
from zope.app.workflow.stateful.interfaces import IAfterRelevantDataChangeEvent
from zope.app.servicenames import Utilities
-from zope.app.traversing import getParent
+from zope.app.traversing.api import getParent
from zope.app.workflow.instance import ProcessInstance
from zope.app.container.contained import Contained
Modified: Zope3/trunk/src/zope/app/zapi/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/zapi/__init__.py 2004-05-25 16:58:29 UTC (rev 24963)
+++ Zope3/trunk/src/zope/app/zapi/__init__.py 2004-05-25 17:27:46 UTC (rev 24964)
@@ -28,7 +28,7 @@
from zope.component import *
-from zope.app.traversing import *
+from zope.app.traversing.api import *
from zope.app.traversing.browser.absoluteurl import absoluteURL
from zope.app.exception.interfaces import UserError
More information about the Zope3-Checkins
mailing list