Commit 1933dd9d authored by 's avatar

- subclass from zope.browserpage.simpleviewclass.simple

parent 37b326ab
......@@ -24,15 +24,14 @@ from zope.component import queryMultiAdapter
from zope.component.interface import provideInterface
from zope.component.zcml import handler
from zope.configuration.exceptions import ConfigurationError
from zope.interface import implements
from zope.interface import Interface
from zope.publisher.interfaces import NotFound
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from zope.security.zcml import Permission
import zope.browserpage.metaconfigure
import zope.browserpage.simpleviewclass
from zope.browserpage.metaconfigure import _handle_allowed_attributes
from zope.browserpage.metaconfigure import _handle_allowed_interface
from zope.browserpage.metaconfigure import _handle_for
......@@ -446,27 +445,14 @@ class simple(BrowserView, zope.browserpage.metaconfigure.simple):
return getattr(self, self.__page_attribute__)
class ViewMixinForTemplates(BrowserView):
# Cloned from zope.app.pagetemplate.simpleviewclass.simple
implements(IBrowserPublisher)
def browserDefault(self, request):
return self, ()
def publishTraverse(self, request, name):
if name == 'index.html':
return self.index
raise NotFound(self, name, request)
class ViewMixinForTemplates(BrowserView,
zope.browserpage.simpleviewclass.simple):
def __getitem__(self, name):
if name == 'macros':
return self.index.macros
return self.index.macros[name]
def __call__(self, *args, **kw):
return self.index(*args, **kw)
# Original version: zope.browserpage.simpleviewclass.SimpleViewClass
def SimpleViewClass(src, offering=None, used_for=None, bases=(), name=u''):
......
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