def mod_import(name): mod = __import__(name) for part in name.split('.')[1:]: mod = getattr(mod,part) return mod
T2 = mod_import('applications.%s.modules.t2'%request.application).T2 t2=T2(request,response,session,cache,T,db) ... Benefits: does not modify sys.path and does not resort to exec'ing. Robin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---