[Zope3-checkins] SVN: Zope3/branches/3.2/ Fixed a bug in the <viewlet> directive handler: extra string attributes were

Marius Gedminas marius at pov.lt
Fri Dec 16 10:24:05 EST 2005


Log message for revision 40814:
  Fixed a bug in the <viewlet> directive handler: extra string attributes were
  ignored if you didn't explicitly specify a class for the viewlet.
  
  

Changed:
  U   Zope3/branches/3.2/doc/CHANGES.txt
  U   Zope3/branches/3.2/src/zope/viewlet/directives.txt
  U   Zope3/branches/3.2/src/zope/viewlet/metaconfigure.py

-=-
Modified: Zope3/branches/3.2/doc/CHANGES.txt
===================================================================
--- Zope3/branches/3.2/doc/CHANGES.txt	2005-12-16 15:22:20 UTC (rev 40813)
+++ Zope3/branches/3.2/doc/CHANGES.txt	2005-12-16 15:24:04 UTC (rev 40814)
@@ -19,6 +19,10 @@
       - Fixed bug 486: Made function getSiteManagerDefault compatible with
         sub-sites.
 
+      - Fixed a bug in the <viewlet> directive handler: extra string
+        attributes were ignored if you didn't explicitly specify a
+        class for the viewlet.
+
   Zope 3.2.0b1 (2005/12/06)
 
     New features

Modified: Zope3/branches/3.2/src/zope/viewlet/directives.txt
===================================================================
--- Zope3/branches/3.2/src/zope/viewlet/directives.txt	2005-12-16 15:22:20 UTC (rev 40813)
+++ Zope3/branches/3.2/src/zope/viewlet/directives.txt	2005-12-16 15:24:04 UTC (rev 40814)
@@ -209,6 +209,7 @@
   ...       manager="zope.viewlet.directives.ILeftColumn"
   ...       template="%s"
   ...       permission="zope.Public"
+  ...       extra_string_attributes="can be specified"
   ...       />
   ... </configure>
   ... ''' % weatherTemplate, context=context)
@@ -220,6 +221,8 @@
   ...     name='weather')
   >>> viewlet.render().strip()
   u'<div>sunny</div>'
+  >>> viewlet.extra_string_attributes
+  u'can be specified'
 
 The manager now also gives us the output of the one and only viewlet:
 

Modified: Zope3/branches/3.2/src/zope/viewlet/metaconfigure.py
===================================================================
--- Zope3/branches/3.2/src/zope/viewlet/metaconfigure.py	2005-12-16 15:22:20 UTC (rev 40813)
+++ Zope3/branches/3.2/src/zope/viewlet/metaconfigure.py	2005-12-16 15:24:04 UTC (rev 40814)
@@ -161,7 +161,8 @@
 
     else:
         # Create a new class for the viewlet template alone.
-        new_class = viewlet.SimpleViewletClass(template, name=name)
+        new_class = viewlet.SimpleViewletClass(template, name=name,
+                                               attributes=kwargs)
 
     # Set up permission mapping for various accessible attributes
     viewmeta._handle_allowed_interface(



More information about the Zope3-Checkins mailing list