Re: PyDS 0.7.2 upgrade problems

Georg Bauer <gb-BRhJDZTO+/[email protected]> Sun, 16 May 2004 23:02:37 +0200
Newsgroups gmane.comp.pythin.pyds.devel
Message-ID <[email protected]>
Hi!

> Tool.py	912	process_request	s = tool.index_html(req)
> MeshTool.py	855	index_html	toolHasSig[tool] = False
> NuggetsTool.py	263	__getattr__	else: raise KeyError(name)

Ah, that's an known thingy. I thought I had stomped them, but there 
seem to be other places where this specific proble pops up. The reason 
is a somehow changed behaviour in __getattr__ stuff. With 2.2 you can 
use an object that has __getattr__ defined in most ways exactly as if 
it hadn't __getattr__ defined. In 2.3 there seem to be much more 
situations where some magic method should be called and that breaks, 
because StandardTool doesn't define that one. Some places where I first 
found them was with code like

if tool:
    # do something

This didn't work with NuggetsTool and MacrosTool because they didn't 
have __nonzero__ defined - neither directly nor by means of 
StandardTool. With 2.2 they had some kind of default behaviour: every 
instance was nonzero. To fix this for 2.3, I defined __nonzero__ for 
tools that define __getattr__. So if you give me the detail for the 
KeyError, I might just plug in the missing method and it should work 
again.

> This is just from clicking on the "Mesh" link on the sidebar, URL is 
> http://127.0.0.1:4334/mesh/ . I haven't dug into this because I don't 
> even know what Mesh does and I don't seem to be missing it ;-)

MeshTool is just to resolve stray links in restructured text. If you 
don't use restructured text and most important if you don't use the 
WikiTool, you won't miss it ;-)

bye, Georg