[Zope3-checkins] SVN: Zope3/branches/roger-contentprovider/src/zope/viewlet/ Some fixes to make viewlet and viewletManager directives operative again after refactoring

Helmut Merz helmutm at cy55.de
Mon Oct 10 14:43:18 EDT 2005


Log message for revision 39032:
  Some fixes to make viewlet and viewletManager directives operative again after refactoring

Changed:
  U   Zope3/branches/roger-contentprovider/src/zope/viewlet/metaconfigure.py
  U   Zope3/branches/roger-contentprovider/src/zope/viewlet/viewlet.py

-=-
Modified: Zope3/branches/roger-contentprovider/src/zope/viewlet/metaconfigure.py
===================================================================
--- Zope3/branches/roger-contentprovider/src/zope/viewlet/metaconfigure.py	2005-10-10 18:38:12 UTC (rev 39031)
+++ Zope3/branches/roger-contentprovider/src/zope/viewlet/metaconfigure.py	2005-10-10 18:43:17 UTC (rev 39032)
@@ -42,6 +42,7 @@
 # TODO: 
 def viewletManagerDirective(_context, name, permission, providerType,
                      for_=Interface, layer=IDefaultBrowserLayer,
+                     view=IBrowserView, 
                      class_=None, template=None, allowed_interface=None):
 
     required = {}
@@ -63,7 +64,7 @@
 
         # Create a new class based on the template and class.
         new_class = viewlet.SimpleViewletClass(
-            template, bases=(class_, ), weight=weight)
+            template, bases=(class_, ))
 
     if hasattr(new_class, '__implements__'):
         classImplements(new_class, IBrowserPublisher)
@@ -72,7 +73,7 @@
     if hasattr(class_, 'providerType'):
         classImplements(new_class, providerType)
 
-    for attr_name in (attribute, 'browserDefault', '__call__',
+    for attr_name in ('browserDefault', '__call__',
                       'publishTraverse', 'weight'):
         required[attr_name] = permission
 
@@ -89,8 +90,8 @@
         discriminator = ('viewletManager', for_, layer, view, name),
         callable = metaconfigure.handler,
         args = ('provideAdapter',
-                (for_, layer, view), IViewletManager, name, new_class,
-                 _context.info),)
+                (for_, layer, view), interfaces.IViewletManager, name,
+                 new_class, _context.info),)
 
 
 
@@ -103,9 +104,9 @@
 
     required = {}
 
-    if interfaces.IWeightSupport.implementedBy(class_) and weight == None:
-        msg = "Must specify a weight if IWeightSupport is implemented"
-        raise ConfigurationError(msg)
+    #if interfaces.IWeightSupport.implementedBy(class_) and weight == None:
+    #    msg = "Must specify a weight if IWeightSupport is implemented"
+    #    raise ConfigurationError(msg)
 
     # Get the permission; mainly to correctly handle CheckerPublic.
     permission = viewmeta._handle_permission(_context, permission)

Modified: Zope3/branches/roger-contentprovider/src/zope/viewlet/viewlet.py
===================================================================
--- Zope3/branches/roger-contentprovider/src/zope/viewlet/viewlet.py	2005-10-10 18:38:12 UTC (rev 39031)
+++ Zope3/branches/roger-contentprovider/src/zope/viewlet/viewlet.py	2005-10-10 18:43:17 UTC (rev 39032)
@@ -22,6 +22,7 @@
 import zope.interface
 
 from zope.app.pagetemplate.simpleviewclass import simple
+from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from zope.app.publisher.browser import BrowserView
 from zope.app.traversing import api
 



More information about the Zope3-Checkins mailing list