[Zope-dev] method attribute __roles__ in Zope 2.8

Jim Fulton jim at zope.com
Mon Feb 21 09:00:07 EST 2005


You didn't use the getattr that Dieter suggested.
But see my other follow on note.

Jim

Andreas Jung wrote:
> 
> 
> --On Sonntag, 20. Februar 2005 19:42 Uhr +0100 Dieter Maurer 
> <dieter at handshake.de> wrote:
> 
>>
>> You can use the "getattr" above to resolve the attribute.
> 
> 
> That really did not help:
> 
> -> print getattr(self.manage_FTPlist, '__roles__')
> (Pdb)
> AttributeError: "'function' object has no attribute '__roles__'"
> 
>>
> /develop/sandboxes/Zope/Zope/lib/python/OFS/ObjectManager.py(669)manage_FTPstat() 
> 
> -> print getattr(self.manage_FTPlist, '__roles__')
> (Pdb) dir(self.manage_FTPlist)
> ['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', 
> '__get__', '__getattribute__', '__hash__', '__init__', '__new__', 
> '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 
> 'im_class', 'im_func', 'im_self']
> (Pdb) self.manage_FTPlist
> <bound method Application.manage_FTPlist of <OFS.Application.Application 
> object at 0xb761fcec>>
> (Pdb) self.manage_FTPlist.__dict__
> {}
> 
> So there must be more magic involved get this code running again.
> 
> Andreas
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )


-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope-Dev mailing list