Understood. That is what exec_environment is for.
On Nov 25, 9:54 am, achipa <[EMAIL PROTECTED]> wrote:
> a) is clear
>
> b) Benchmarking, notifications, automation, basically anything that is
> not an interactive user request coming from a browser. Modules are
> cumbersome as you have to import loads of controller style logic and
> you end up with one-liner controller functions which just invoke
> module functions and a bloated module with all sorts of imports and
> calls that web2py controllers do by default. That's what I meant by
> referring to cruft. Note that the fact that it's not a browser call
> does NOT mean it does not have an output ! In the simplest form, I
> want to get rid of wgethttp://localhost/app/controller/functionstyle
> calls in favor of direct calls (wget calls being the dark side, I
> know, but so much simpler and quicker than moving controller content
> to modules).
>
> On Nov 25, 4:24 pm, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > Sorry, I misunderstood the question.
>
> > Answer a)
> > With -R you can execute a script. You can use exec_environment(...) to
> > call a function in a controller. It is described in the manual.
>
> > Answer b)
> > If you feel you need to do this perhaps something is wrong. perhaps
> > the function belongs to a module, not a controller. Or perhaps you are
> > doing something I never thought of.
>
> > Massimo
>
> > On Nov 25, 9:04 am, achipa <[EMAIL PROTECTED]> wrote:
>
> > > Maybe it's just the lack of coffee, but... how do you call a function
> > > in the controller via -R without ending up with cruft in the calling
> > > code or the controller itself ?
>
> > > On Nov 25, 3:26 pm, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > > > -R is the cleanest way. ;-)
>
> > > > On Nov 25, 4:55 am, achipa <[EMAIL PROTECTED]> wrote:
>
> > > > > The subject says it all. I know a couple of methods (python -R
> > > > > wrapper, the older -S patch, piping, etc), but was wondering which you
> > > > > think is the cleanest (and cross platform) as I'd like to integrate it
> > > > > into my cron patch (so you could specify controllers/functions in your
> > > > > crontab file, not just executables).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---