Re: [Zope3-Users] Convert from string to class

2006-01-18 Thread Adam Groszer
Hello Florian, There is a full-blow method for that in src\zope\configuration\config.py in the class ConfigurationContext called resolve. Tuesday, January 17, 2006, 11:10:12 PM, you wrote: Hello, I've a string like zope.app.folder.Folder and I want to get the class zope.app.folder.Folder

Re: [Zope3-Users] Convert from string to class

2006-01-18 Thread Dominik Huber
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. another implementation ;) zope.dottedname.resolve.resolve

[Zope3-Users] Convert from string to class

2006-01-17 Thread Florian Lindner
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

Re: [Zope3-Users] Convert from string to class

2006-01-17 Thread Marc Rijken
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

Re: [Zope3-Users] Convert from string to class

2006-01-17 Thread Gary Poster
On Jan 17, 2006, at 5:10 PM, 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. Was just rewriting this

Re: [Zope3-Users] Convert from string to class

2006-01-17 Thread Markus Leist
Hello, what about: http://www.talkaboutprogramming.com/group/comp.lang.python/messages/318370.html Markus 17.01.2006 23:10, Florian Lindner: 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