In general, have a look at the contents of request.global_settings.cmd_options -- it includes the various command line options specified when starting web2py.
Anthony On Friday, August 3, 2012 9:13:56 PM UTC-4, Anthony wrote: > > On 08/03/2012 02:53 PM, Anthony wrote: >> > There's also request.global_settings.cronjob. >> >> Cool but where do I've request available? It's not at import time but >> i've a request object in web2py.py -M -S milo >> >> So when can i know that request is a valid object? >> > > When you said "worker", I assumed you were using the web2py Scheduler -- > is that the case? If so, you can put something like the following in the > model or controller that does the import: > > if request.global_settings.scheduler: > [do the time-consuming import] > > If you're not using the Scheduler, what do you mean by "worker"? > > Anthony > --

