from ZPublisher.BaseRequest import DefaultPublishTraverse from zope.publisher.interfaces import IPublishTraverse from zope.publisher.interfaces import NotFound from zope.interface import implements from zope.publisher.http import IHTTPRequest from zope.component import adapts from interfaces import ISCORMFile class ContentTraverser(object): """ asdasd """ adapts(ISCORMFile, IHTTPRequest) implements(IPublishTraverse) def __init__(self, context, request): self.context = context self.default = DefaultPublishTraverse(context,request) def publishTraverse(self, request, name): try: obj = self.default.publishTraverse(request, name) except (NotFound, AttributeError), e: obj = self.context.locate(request, name) return obj