No because the path would depend on the order apps are first executed.
On Apr 23, 12:36 am, Iceberg <[email protected]> wrote:
> Just some thought. Is it a good idea that if web2py can automatically
> do this BEFORE accessing an app?
>
> old_syspath=sys.path
> sys.path.append(os.path.abspath('applications/%s/
> modules'%request.application))
> try:
> serve_currect_request()
> finally: sys.path=old_syspath # So that different app won't mess up
> their own modules
>
> In this way, hopefully app can call third party modules in the usual,
> simple, straightforward way, like this:
>
> import mylib # rather than: import applications.myapp.modules.mylib
>
> On Apr23, 11:19am, mdipierro <[email protected]> wrote:
>
> > probably
>
> > import applications.myapp.modules.modulefolder.twitter as twitter
>
> > or better
>
> > exec('import applications.%s.modules.modulefolder.twitter as
> > twitter' % request.application)
>
> > Massimo
>
> > On 22 Apr, 22:03, Michael <[email protected]> wrote:
>
> > > This makes sense, but do i put the whole folder inside of modules?
>
> > > would i access the library by saying
>
> > > import applications.myapp.modules.modulefolder
>
> > > or
>
> > > import applications.myapp.modules.modulefolder.twitter.py
>
> > > thanks! sorry for being such a newb ;P
>
> > > On Apr 22, 10:02 pm, Iceberg <[email protected]> wrote:
>
> > > > I don't know mac, but when using Windows binary (the web2py_win.zip),
> > > > I can always put 3rd party libraries into web2py/applications/myapp/
> > > > modules, then access it, in a slightly different way:
>
> > > > import applications.myapp.modules.third_parti_lib
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---