in deferred I don't have a direct access to *request.** *Usually I use request
= current.request, that is why I need an access to 'current'. But this is a
no go. So I have to provide the path to web2py for deferred somehow.
import os
from gluon.settings import global_settings
web2py_path = os.p
And here is why GAE loses the path (sometimes)
http://code.google.com/p/googleappengine/issues/detail?id=772#c11
All, this is now an officially acknowledged bug. The cause is a "feature" which
resets sys.path to a fixed default at the start of each request. Due to where
we are
in the QA cycle
Here is how Google described it:
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
Would os.path.abspath(request.folder) work as well? It works on Windows
(actually, request.folder itself appears to be the absolute path on
Windows).
Anthony
On Tuesday, December 13, 2011 2:04:09 PM UTC-5, Ross Peoples wrote:
>
> I've never used GAE before, but you would normally get the absolu
I've never used GAE before, but you would normally get the absolute path to
web2py using something like this:
import os
from gluon.settings import global_settings
web2py_path = os.path.join(global_settings.applications_parent,
request.folder)
Hope that helps.
It is related to deferred.defer in GAE:
https://groups.google.com/forum/#!topic/web2py/Fp7B477Db8c
I made it work but I am using 'current' object to get request/response/mail.
It works but sometimes does not. It seems deferred library loses the
path of web2py sometimes. I am investigating how to
I don't think you can because "current" is a threaded object. It contains 3
things: request, response, session. You could probably serialize much of
the data contained in those three objects, however, this will be difficult
because they contain functions. Web2py does a lot of this when it genera
or how to serialize it?
8 matches
Mail list logo