I went in a similar problem with an webapp that needs to add routes to
the Python path.
I didn't need a special module. Just made the path adjustments in the
app's specific routes.py module that executes once when web2py starts.
Doing path modifications is troublesome (something to do with
threading)

Look here
http://groups.google.com/group/web2py/browse_thread/thread/607e9c384ec220e0/2199c108556060e7

I belive GAE does not support the use of os and sys. Check for updates
on the subject.

On 6 dic, 15:03, Constantine Vasil <thst...@gmail.com> wrote:
> I am using deferred library with GAE. In order to do that I have to define
> a
>  'fix_path' module and import the 'fix_path' in the module  deferred.defer.
>
> What I need to do in order deferred to work with web2py?
>
> Regards,
> --Constantine
>
> http://code.google.com/appengine/articles/deferred.html
> Handling import path manipulation
>
> Some applications, or the frameworks they use, rely on manipulating the
> Python import path in order to make all the libraries they need available.
> While this is a perfectly legitimate technique, the deferred library has no
> way of knowing what path manipulations you've engaged in, so if the task
> you're deferring relies on modules that aren't on the import path by
> default, you need to give it a helping hand. Failing to do this can result
> in your tasks failing to run - or worse, only failing intermittently.
>
> Fortunately, handling this is easy. Make sure your code that changes the
> import path is in a module all of its own, such as 'fix_path.py'. Such a
> module might look like this:
>
> import os
> import sys
>
> sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
>
> Then, import the 'fix_path' module along with your usual imports, anywhere
> you rely on the modified path, such as in the module you defined the
> functions you're calling with deferred.defer in.

Reply via email to