[web2py] Re: request.folder

2017-03-23 Thread Anthony
Feel free to open a Github issue? It looks like it is something that can be corrected. On Thursday, March 23, 2017 at 8:21:09 AM UTC-4, Oliver Holmes wrote: > > I know I can work around a lot of issues. I just thought it might interest > anyone, that the documentation is at least incomplete.

[web2py] Re: request.folder

2017-03-23 Thread Oliver Holmes
I know I can work around a lot of issues. I just thought it might interest anyone, that the documentation is at least incomplete. Plus after a recent update of my system (not my source code, just the libs and debian itself), relative paths did not work (for os.path.exists at least). Otherwise I

[web2py] Re: request.folder

2017-03-21 Thread Anthony
How does this cause problems for you? Note, because starting the shell or scheduler involves calling web2py.py in the /web2py folder, the Python working directory will be /web2py, so request.folder will be relative to the /web2py folder from the perspective of the Python interpreter. If you

[web2py] Re: request.folder

2017-03-21 Thread Oliver Holmes
Yes, this behavior just annoyed the hell out of me too. When referenced in the application itself request.folder behaves as documented her: http://web2py.com/books/default/chapter/29/04/the-core#request ( (i.e. full absolute path). But as soon as it is used in a module called as scheduled task

[web2py] Re: request.folder loses its /s

2012-03-20 Thread weheh
Ah ... never mind. This seems to be a \ quoting problem, but one I've never encountered before. It's biting me in an ajax callback routine. It looks like I may have to quote a bunch of \s and now I'm just trying to figure out how many I have to quote. On Mar 20, 9:41 pm, weheh

Re: [web2py] Re: request.folder loses its /s

2012-03-20 Thread Jonathan Lundell
On Mar 20, 2012, at 6:54 AM, weheh wrote: Ah ... never mind. This seems to be a \ quoting problem, but one I've never encountered before. It's biting me in an ajax callback routine. It looks like I may have to quote a bunch of \s and now I'm just trying to figure out how many I have to

[web2py] Re: request.folder loses its /s

2012-03-20 Thread weheh
I got into this pickle because I was using a URL(c='static', f='images', ...) to download an image under static/images. The problem was that the image download was taking place from a component, so a .load suffix was getting spliced into the middle of the path like this:

[web2py] Re: request.folder loses its /s

2012-03-20 Thread Anthony
The URL() function automatically uses the extension of the current request (i.e., request.extension) unless explicitly overridden or suppressed. You can suppress the extension via URL(..., extension=False). See the very end of this section in the book:

[web2py] Re: request.folder loses its /s

2012-03-20 Thread weheh
Thanks, Anthony. It's been a long time since I read that piece of doc, so I'm not surprised to see my knowledge is a bit dated. On Mar 20, 10:54 pm, Anthony abasta...@gmail.com wrote: The URL() function automatically uses the extension of the current request (i.e., request.extension) unless

[web2py] Re: request.folder loses its /s

2012-03-20 Thread weheh
Works like a charm. Thanks.

[web2py] Re: request.folder loses its /s [closed]

2012-03-20 Thread weheh
On Mar 21, 12:51 am, weheh richard_gor...@verizon.net wrote: Thanks, Anthony. It's been a long time since I read that piece of doc, so I'm not surprised to see my knowledge is a bit dated. On Mar 20, 10:54 pm, Anthony abasta...@gmail.com wrote: The URL() function automatically uses