, I fixed widget.py code here and there to correctly pick up the -f option.
Yes, we have one, but was lagging behind.
Oddly enough, half an hour later I fixed most of it (I really thought I had to spend more time into it).
This enables a simple (enough) trick.
On windows, you can create a dir. Put a web2py.bat in it containing
python thepathto\web2py.py -f %~dp0 %*
AND a folder, named "applications", containing your apps.
You can then cd into that dir, and launch, e.g.
webp2y.bat -a mypassword
or
web2py.bat -K myappname
or
------ well, you got it.
dos makes it easy because %~dp0 is the dir where the bat lives, while %* are all arguments passed to it.
Unixy-like should create a web2py.sh containing something like (not tested)
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
python web2py.py -f "$MY_PATH" "$@"
- cron, oldcron, newcron untested. I'm not sure I'll ever be in a right state of mind either to test it or to fix the code
- widget (grrr) updates the canvas at the bottom looking at a fixed httpserver.log. Fixed!
- latest releases don't do this step
https://github.com/web2py/web2py/blob/master/gluon/widget.py#L1120 at all. Changing the correct pointer to logging.example.conf fixes the issues, but it creates another. In logging example, verbatim, a rotating log is created in a subdirectory, that can very well not exist. Either we fix logging.example to log to web2py.log instead of logs/web2py.log, or we need to create a "logs" directory in the current one
- widget can't correctly launch scheduler processes from the menu. A big ##FIXME later, if -f is found, no scheduler menu is created :-P
BTW: I remember someone talking about packaging web2py. Latest attempt resulted in copying over a tar(red) env here and there. Ugly to say the least, and unmaintained from day 2.
This would be the right occasion to chime in, because the fixed code should - at least - enable some kind of package "script", e.g. "web2py launcher" to, basically:
- determine the current absolute path
- launch web2py.py -f that_path
- pass along any other parameter
which is arguably EASIER to write in python than ask to drop weird stuff in your app's dir
What do you think ?