[Zope-dev] ZPatterns: bug in DataSkins.py
Steve Alexander
steve@cat-box.net
Sun, 30 Jul 2000 22:22:25 +0100
"Phillip J. Eby" wrote:
>
> At 08:07 PM 7/30/00 +0100, Steve Alexander wrote:
> >Steve Alexander wrote:
> >>
> >> I'm using ZPatterns 0.4.1snap1.
> >>
> >> DataSkins.py line 377
> >> method _v_currentSheets(self,_v_dm_=_v_dm_)
> >>
> >> l.extend(list(sp._PropertySheetsFor(client)))
> >>
> >> However, the variable "client" isn't declared elsewhere.
> >
> >..and when I replace it with "self", I get this error when I try to
> >iterate through a dataskin's propertysheets:
> >
>
> Would you try something for me? Stick a routine in that class, call it
> getCurrentSheets(), with exactly the same code as the _v_currentSheets
> method, then call it from your code in place of iterating through
> propertysheets? I have a feeling it'll provide a clearer error message.
> (That's the only problem with ComputedAttributes - errors that break them
> manifest as AttributeErrors, hiding the true error.) Thanks.
ok.
I think I've found the problem... I removed my own custom SheetProvider
from the Specialist, and it works as expected.
Here's the traceback with the new method, and my broken sheetprovider
still in place:
AttributeError: _PropertySheetsFor
Traceback (innermost last):
File /usr/local/zope/SiteBox/lib/python/ZPublisher/Publish.py, line
222, in publish_module
File /usr/local/zope/SiteBox/lib/python/ZPublisher/Publish.py, line
187, in publish
File /usr/local/zope/SiteBox/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: address-964970042)
File /usr/local/zope/SiteBox/lib/python/ZPublisher/Publish.py, line
171, in publish
File /usr/local/zope/SiteBox/lib/python/ZPublisher/mapply.py, line
160, in mapply
(Object: content_html)
File /usr/local/zope/SiteBox/lib/python/ZPublisher/Publish.py, line
112, in call_object
(Object: content_html)
File /usr/local/zope/SiteBox/lib/python/OFS/DTMLMethod.py, line 167,
in __call__
(Object: content_html)
File /usr/local/zope/SiteBox/lib/python/DocumentTemplate/DT_String.py,
line 502, in __call__
(Object: content_html)
File /usr/local/zope/SiteBox/lib/python/DocumentTemplate/DT_In.py,
line 633, in renderwob
(Object: getCurrentSheets())
File /usr/local/zope/SiteBox/lib/python/DocumentTemplate/DT_Util.py,
line 337, in eval
(Object: getCurrentSheets())
(Info: getCurrentSheets)
File <string>, line 0, in ?
File
/usr/local/zope/SiteBox/lib/python/Products/ZPatterns/DataSkins.py, line
376, in getCurrentSheets
(Object: address-964970042)
File
/usr/local/zope/SiteBox/lib/python/Products/ZPatterns/Providers.py, line
268, in _PropertySheetsFor
(Object: PlugInBase)
AttributeError: (see above)
--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net