[Zope-Checkins] SVN: Zope/trunk/src/Products/Five/browser/metaconfigure.py - subclass from zope.browserpage.simpleviewclass.simple

Yvo Schubbe cvs-admin at zope.org
Tue Jul 10 12:41:56 UTC 2012


Log message for revision 127296:
  - subclass from zope.browserpage.simpleviewclass.simple

Changed:
  U   Zope/trunk/src/Products/Five/browser/metaconfigure.py

-=-
Modified: Zope/trunk/src/Products/Five/browser/metaconfigure.py
===================================================================
--- Zope/trunk/src/Products/Five/browser/metaconfigure.py	2012-07-10 12:35:00 UTC (rev 127295)
+++ Zope/trunk/src/Products/Five/browser/metaconfigure.py	2012-07-10 12:41:52 UTC (rev 127296)
@@ -24,15 +24,14 @@
 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,28 +445,15 @@
         return getattr(self, self.__page_attribute__)
 
 
-class ViewMixinForTemplates(BrowserView):
-    # Cloned from zope.app.pagetemplate.simpleviewclass.simple
-    implements(IBrowserPublisher)
+class ViewMixinForTemplates(BrowserView,
+                            zope.browserpage.simpleviewclass.simple):
 
-    def browserDefault(self, request):
-        return self, ()
-
-    def publishTraverse(self, request, name):
-        if name == 'index.html':
-            return self.index
-
-        raise NotFound(self, name, request)
-
     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''):
     if bases:



More information about the Zope-Checkins mailing list