Component.attributes is broken
Brought to you by:
zzzeek
The Component.attributes accessor as in (release 0.98a)
will only look up a maximum of one level in the
inheritance graph to find an attribute.
I've attached a patch.
For specificity, here's untested example code which
will exercise the bug:
===in /a.myt===
<%attr>
foo = 'fooval'
</%attr>
===in /b.myt===
<%flags>
inherit = '/a.myt'
</%flags>
<%attr>
bar = 'barval'
</%attr>
===in /c.myt===
<%flags>
inherit = '/b.myt'
</%flags>
# This is okay; it finds the 'bar' attribute from /b.myt:
<% m.base_component.attributes['bar'] %>
# This throws an AttributeError, doesn't find /a.myt's,
'foo':
<% m.base_component.attributes['foo'] %>
=============
Patch to fix Component.attributes bug.
Logged In: YES
user_id=1100624
patch applied, CVS rev 1.77, and a test case added to
test/component.py