[ZPatterns] ZPatterns not TTW, step 2

Steve Spicklemire steve@spvi.com
Sun, 10 Jun 2001 14:32:13 -0500


Hi RDM,

	I've used an External method to do this as well, something like:

import string

def setObjectAttrs(self, object, attrs):
     attrList = []
     for k in attrs.keys():
         if hasattr(object, k):
             setattr(object, k, attrs[k])
             attrList.append(k)

     return "Updated attributes " + string.join(attrList, ',') + "." + \
			" Orig attrs: " + `attrs` + "."

So a ZClass wouldn't be strictly necessary.

-steve

On Sunday, June 10, 2001, at 01:13 PM, R. David Murray wrote:

> Well, after a little discssion with Christian Scholz on IRC, and
> some wandering around in the code, I figured out that I don't need
> property sheets (I think).  From my point of view there isn't much
> point in having a zclass, but it *looks* from the code like not
> using a zclass will lead to problems (I haven't tried to bypass
> manage_setStorage, so I don't know for sure that it is, but it
> looks like it).
>
> Anyway, it looks at first glance like this will work for me (declare
> this zclass, use it in manage_setStorage, but have the python code
> in methods on the base class just read and write attributes directly),
> so I'm satisfied.
>
> The reason I thought I needed property sheets was that in my previous
> TTW effort manage_changeProperties was the only way I found to get
> attribute setting to be recognized (I was doing the setting from
> pythonscripts).
>
> --RDM
>
>
> _______________________________________________
> ZPatterns mailing list
> ZPatterns@eby-sarna.com
> http://www.eby-sarna.com/mailman/listinfo/zpatterns