[Zope3-checkins] SVN: Zope3/trunk/ Fixed a bug in the <viewlet>
directive handler: extra string attributes were
Marius Gedminas
marius at pov.lt
Fri Dec 16 10:41:39 EST 2005
Log message for revision 40815:
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/trunk/doc/CHANGES.txt
U Zope3/trunk/src/zope/viewlet/directives.txt
U Zope3/trunk/src/zope/viewlet/metaconfigure.py
-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt 2005-12-16 15:24:04 UTC (rev 40814)
+++ Zope3/trunk/doc/CHANGES.txt 2005-12-16 15:41:38 UTC (rev 40815)
@@ -13,6 +13,10 @@
- zope.app.content_types is now the package zope.app.contenttypes
(code backported from Zope 2)
+ - 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)
Modified: Zope3/trunk/src/zope/viewlet/directives.txt
===================================================================
--- Zope3/trunk/src/zope/viewlet/directives.txt 2005-12-16 15:24:04 UTC (rev 40814)
+++ Zope3/trunk/src/zope/viewlet/directives.txt 2005-12-16 15:41:38 UTC (rev 40815)
@@ -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/trunk/src/zope/viewlet/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/viewlet/metaconfigure.py 2005-12-16 15:24:04 UTC (rev 40814)
+++ Zope3/trunk/src/zope/viewlet/metaconfigure.py 2005-12-16 15:41:38 UTC (rev 40815)
@@ -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