Re: [Zope-dev] ZPatterns: bug in DataSkins.py
"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 , 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 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns: bug in DataSkins.py
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. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns: bug in DataSkins.py
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: AttributeError: _v_currentSheets 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 636, in renderwob (Object: propertysheets) File /usr/local/zope/SiteBox/lib/python/OFS/PropertySheets.py, line 654, in __len__ (Object: Traversable) File /usr/local/zope/SiteBox/lib/python/Products/ZPatterns/PropertySheets.py, line 11, in __propsets__ (Object: Traversable) AttributeError: (see above) -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns: bug in DataSkins.py
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. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )