[Zope3-checkins] CVS: Zope3/src/zope/app/index - subscribers.py:1.11
Albertas Agejevas
alga@codeworks.lt
Wed, 19 Mar 2003 14:58:00 -0500
Update of /cvs-repository/Zope3/src/zope/app/index
In directory cvs.zope.org:/tmp/cvs-serv11034/src/zope/app/index
Modified Files:
subscribers.py
Log Message:
Renamed getPgysicalPathString() to getPath().
Got rid of getPhysicalPath() (which used to return a tuple) by replacing it
by getPath().
=== Zope3/src/zope/app/index/subscribers.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/index/subscribers.py:1.10 Wed Mar 19 12:55:36 2003
+++ Zope3/src/zope/app/index/subscribers.py Wed Mar 19 14:57:29 2003
@@ -39,8 +39,7 @@
from zope.component import getService, queryAdapter
from zope.app.services.servicenames import HubIds
-from zope.app.traversing import traverse, traverseName, \
- getPhysicalPath, getRoot
+from zope.app.traversing import traverse, traverseName, getPath, getRoot
from zope.app.interfaces.services.hub import ObjectHubError
class ISubscriptionControl(Interface):
@@ -137,12 +136,11 @@
# security proxies.
# For now, we pick the first approach.
- location = getPhysicalPath(context)
- # Location is a tuple of strings, starting with '' (for the root)
- for i in range(len(location)):
- if location[i] == "++etc++Services":
- location = location[:i]
- break
+ location = getPath(context)
+
+ index = location.find('/++etc++Services/')
+ if index != -1:
+ location = location[:index]
else:
raise ValueError, "can't find '++etc++Services' in path"
root = getRoot(context)