Commit 2001fb27 authored by Hanno Schlichting's avatar Hanno Schlichting

Replace self.REQUEST with ac_acquire(self, 'REQUEST')

parent 9f18a95b
...@@ -22,7 +22,7 @@ from AccessControl import ClassSecurityInfo ...@@ -22,7 +22,7 @@ from AccessControl import ClassSecurityInfo
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from AccessControl import Unauthorized from AccessControl import Unauthorized
from AccessControl.ZopeGuards import guarded_getattr from AccessControl.ZopeGuards import guarded_getattr
from Acquisition import Acquired, aq_inner, aq_parent, aq_base from Acquisition import Acquired, aq_inner, aq_parent, aq_acquire, aq_base
from zExceptions import NotFound from zExceptions import NotFound
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from OFS.interfaces import ITraversable from OFS.interfaces import ITraversable
...@@ -64,7 +64,7 @@ class Traversable: ...@@ -64,7 +64,7 @@ class Traversable:
spp = self.getPhysicalPath() spp = self.getPhysicalPath()
try: try:
toUrl = self.REQUEST.physicalPathToURL toUrl = aq_acquire(self, 'REQUEST').physicalPathToURL
except AttributeError: except AttributeError:
return path2url(spp[1:]) return path2url(spp[1:])
return toUrl(spp) return toUrl(spp)
...@@ -78,7 +78,7 @@ class Traversable: ...@@ -78,7 +78,7 @@ class Traversable:
""" """
spp = self.getPhysicalPath() spp = self.getPhysicalPath()
try: try:
toUrl = self.REQUEST.physicalPathToURL toUrl = aq_acquire(self, 'REQUEST').physicalPathToURL
except AttributeError: except AttributeError:
return path2url(spp) or '/' return path2url(spp) or '/'
return toUrl(spp, relative=1) or '/' return toUrl(spp, relative=1) or '/'
...@@ -93,7 +93,7 @@ class Traversable: ...@@ -93,7 +93,7 @@ class Traversable:
""" """
spp = self.getPhysicalPath() spp = self.getPhysicalPath()
try: try:
toVirt = self.REQUEST.physicalPathToVirtualPath toVirt = aq_acquire(self, 'REQUEST').physicalPathToVirtualPath
except AttributeError: except AttributeError:
return path2url(spp[1:]) return path2url(spp[1:])
return path2url(toVirt(spp)) return path2url(toVirt(spp))
...@@ -192,7 +192,7 @@ class Traversable: ...@@ -192,7 +192,7 @@ class Traversable:
if ns: if ns:
try: try:
next = namespaceLookup( next = namespaceLookup(
ns, nm, obj, self.REQUEST) ns, nm, obj, aq_acquire(self, 'REQUEST'))
if restricted and not validate( if restricted and not validate(
obj, obj, name, next): obj, obj, name, next):
raise Unauthorized(name) raise Unauthorized(name)
...@@ -256,7 +256,7 @@ class Traversable: ...@@ -256,7 +256,7 @@ class Traversable:
except (AttributeError, NotFound, KeyError), e: except (AttributeError, NotFound, KeyError), e:
# Try to look for a view # Try to look for a view
next = queryMultiAdapter((obj, self.REQUEST), next = queryMultiAdapter((obj, aq_acquire(self, 'REQUEST')),
Interface, name) Interface, name)
if next is not None: if next is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment