Hi Florian,

This function will do the job:

def translateDottedName(i):
   names = i.split('.')
module = __import__('.'.join(names[:-1]), {}, {}, ['*'])
   return getattr(module, names[-1])

Marc


Florian Lindner wrote:

Hello,
I've a string like "zope.app.folder.Folder" and I want to get the class zope.app.folder.Folder from this string. How can I do that?
It's probably more a python problem that Zope... but I hope you excuse.


Thanks,

Florian
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to