I see... but I don't think the helper would be that useful because
imported modules may themselves import other modules, with the usual
"import" keyword, not the helper.

Perhaps applications could have the privilege to install libraries in
contrib when they install ? Some post-install script could be
executed. Of course then there would be a need of a post-deinstall
script.

I think the __init__.py polluting the sys.path is not that bad, at
least it's simple, keeps up with the "self-contained" philosophy and
the namespace collision risk should be low enough. Plus it lets the
user install the libraries in site-packages if he wants to, without
any change in the application code.

Or maybe I just think too much and I should get that application up
and running no matter how :-)

On Apr 28, 10:54 am, Iceberg <iceb...@21cn.com> wrote:
> I just guess, perhaps that would pollute the sys.path. Imagine this
> case, app_one and app_two both have a homebred module named "modules/
> mylib.py", you can not know which one is actually called when using
> just "import mylib".
>
> Searching from this maillist, I found some post relevant to this topic
> like this. Don't know whether that helper is finally accepted. Massimo
> might have something to 
> say.http://groups.google.com/group/web2py/browse_frm/thread/f9e117f081cfa...
>
> On Apr28, 4:09pm, desfrenes <desfre...@gmail.com> wrote:
>
> > Hello !
>
> > Because I needed mutagen in a project, I added this to the __init__.py
> > of my application:
>
> > import sys, os
> > # add modules dir to sys.path
> > sys.path.append( os.path.abspath(request.folder + 'modules/'))
>
> > It works like a charm but why isn't "modules" already in sys.path
> > since its purpose is to hold 3rd party modules that may be imported
> > later ?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to